RE: Designing a renderer

"Timur Davidenko" <[email protected]> Wed, 2 Jul 2003 09:34:33 +0200
Newsgroups gmane.games.devel.design
Message-ID <[email protected]>
Actually HWND is a simple handle and can be passed just as a void*,
Sure you can make more general abstraction and create OS independed =
Window class, but OSes can differ greatly and its hard to get it right =
at start.
If i would want to make stuff simple, some common initialzation =
structure like
struct RendererInitParams
{
  void *hwnd;
  .. some other stuff.=20
}
then DX renderer can be only on windows platform
so it is compiled with windows headers, simple cast void *hwnd into HWND =
internally.
in OGL renderer you can used defines to see OS and use either windows =
code and use void *hwnd, or if its Linux ignore this value.

Not a most generic solution in the world, but its fast to get running =
and actually quite flexible, considering that you dont have 300 =
different OSes arround.
and getting universal portable window class other all OSes and Consoles =
are a task by itelf and you should consider do you really want to spent =
time on this.

_________________________________
Timur Davidenko.
Crytek Studios (http://www.crytek.com)


-----Original Message-----
From: Dirk Gregorius [mailto:[email protected]]
Sent: Tuesday, July 01, 2003 11:19 AM
To: [email protected]
Subject: [GD-Design] Designing a renderer


Hi,

I am wondering how you implement your render interfaces? On what =
abstraction
level is a renderer normally implemented - what are the typical =
functions
and classes? Do you pass a renderer reference to all renderable =
entities?
And how is platform independence achieved - do you use polymorphism or =
for
example the "Bridge" pattern - that by its definition seperates =
abstraction
and implementation? Maybe you can give me some tips.

One thing that I really don't understand is how to implement the
initialisation such that it works platform independent? E.g: Let's say =
we
have a base class IRenderer which is implemented by two derived class
COGLRendererImpl and CDXRendererImpl. Both derived classes implement a
virtual function IRenderer::Init(...). The arguments vary with the OS. =
On a
Windows platform you have to pass the HWND for the window, on a Linux =
system
that could be totally different. What is the best to handle this?

Hopefully I could make myself clear.  Every help is appreciated!!

Best regards


Dirk



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Gamedevlists-design mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-design
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=3D556


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Gamedevlists-design mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-design
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=556