Cross-Platform Architecture

Started by
23 comments, last by JorenJoestar 16 years, 1 month ago
Nothing ? :S
Advertisement
Maybe the consoles don't need to setup a window, but they certainly also require some initialization. For example on the PSP you have to setup a main thread, some callback functions and initialize the GU. Maybe you should write an "Init()" function that creates a window on PC's and just does some initialization on the other platforms.

Also realize that some of these platforms might not even support C++. I believe a great part of the standard library is ported for the PSP, but keep an eye on this for other consoles. Then there's also some more specific things like the PSP requiring data aligned on 16 bit boundaries, texture swizzling is required for optimal performance, you have to flush the CPU's cache in time to avoid data corruption,... You see, cross platform development is really not easy and there's many tricky little things you should look out for.
Thanks for the answer...
Ok, i should do this but my problem is that parameters are different ( on windows they are size, position, etc and consoles don't have that )...
Window = Screen.

It's not going to do much on a console but hold width/height info and possibly handle PAL/NTSC differences. Obviously there's a little more to it on a PC, though.
I found useful to see the code of the WildMagic engine, along with the book "3D Game Engine Design" and on the web: www.geometrictools.com.

It is build using subsystems, so you have an Application subsystem, which handles the creation of the window and the message queue. It has different implementations for directx, opengl under windows, opengl under linux and mac.
Then there is the renderer subsystems, that handles all the API specific functions. The renderer class is abstract, and the different implementations let you use only the implementation you want.
And then there are all the other subsystems, like graphic, physics...

I'm building my own engine with an architecture like that (PC-Only) and I love it!
All subsystems procude static libraries...then if you want an app, you use the SDK
built with those libraries and the headers!

Hope it helps!
---------------------------------------http://badfoolprototype.blogspot.com/

This topic is closed to new replies.

Advertisement