What are you puting this on a java forum ? You may ask.
The answer is if i don’t do it in C++ then something i have great pride for will be severely cut from me.
But why are you betraying java ? You may ask again rightfuly.
The answer is that im trying to do an engine in C++ the way im used to program in Java. The problem is that in all the C++ forums i post people are completely cluless of what i intend to do because im thinking in Java.
First limitation i cant use classes dynamicaly in an easy way.
Second limitation i want to do an event dispatcher similar to the one in Java3d but i can’t use threads.
Heres a trace of the execution of the engine im planing:
open log file for errors
read config file
…look for os specific info
…look for os layer class to use NOTE: this can be SDL, Allegro, OpenGL, etc
load os layer class at runtime
bind os layer class to os layer independent interface NOTE: use os layer independent interface for now on for everything
initialize game screen
initialize game console
initialize game devices
read config file for extensions to load
load extensions in order they apear in config file
…load modules NOTE: modules are function libaries that obey a certain interface and access only other modules or game functions, so they are os safe
…load resources
…register module ids and module startup status (active|inactive)
…bind module classes to module class interfaces
…register resource ids and memory usage policy (permanent|load-on-demand|volatile)
start event loop
…poll devices
…enqueue events
…preprocess event queue
…if exit event leave
…dispatch events to modules
…repeat
finalize and exit
I must load the os layer code at runtime after reading the config file, possibly checking for the name of a class then load it and initialize it then cast it up to a universal os layer interface and use it that way.
Don’t have a clue how to do this in C++.
The modules must be loaded at runtime after the engine check for a list of modules to load. Each module implements (inherits in C++) the universal module interface and must be casted to one of these after being loaded.
Im clueless here too.
Finaly i must implement an event loop similar to the one described in the trace but without using threads.
As you guys can see im in deep shit here.
I may try to convert this stuff yo Java later for my great releave but now i need help doing it in C++.
Any ideas ?