RE: Designing a renderer
[email protected] Wed, 2 Jul 2003 10:18:48 +0100
| Newsgroups | gmane.games.devel.design |
|---|---|
| Message-ID | <[email protected]> |
We don't pass in the HWND to our renderer but rather let it use Win32 API calls to get the HWND. We pass in the title string of the window from our main app to the renderer init function. This is ignored for those renderers that don't need it. Another option is to pass in argc, argv like variables to the Init of the renderer. Jake -----Original Message----- From: Timur Davidenko [mailto:[email protected]] Sent: 02 July 2003 08:35 To: [email protected] Subject: RE: [GD-Design] Designing a renderer 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. } 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=556 ------------------------------------------------------- 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_idU6 ------------------------------------------------------- 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