Re: Designing a renderer
"Dirk Gregorius" <[email protected]> Wed, 2 Jul 2003 19:36:21 +0200
| Newsgroups | gmane.games.devel.design |
|---|---|
| Message-ID | <000b01c340c0$73f01c00$9ec4c4d5@Maschine> |
Thanx for your honest words. To clear things up let me tell you what I do: I work at a university and we research about emotions in motion and my task is to write some kind of API that could be used in a game environment. The reason I asked was to get an idea how games are implemented by professionals and not hobbist. So maybe we forget the question and maybe you allow me to ask again but in a different way. What is a renderer? And how is it implemented in a common way? What classes and functions contains the render module normally? E.g: Is a class that represents a TriMesh part of the renderer module? Best regards Dirk ----- Original Message ----- From: "Garett Bass" <[email protected]> To: <[email protected]> Sent: Tuesday, July 01, 2003 7:38 PM Subject: RE: [GD-Design] Designing a renderer > Dirk wrote: > > > 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. > > I don't know how others handle this, but I have a windowing system > abstraction layer that hides all the platform specifics such as window > handles and such, and just lets me create, size, move windows. One subclass > of the window class is a 3D context window, which can be sized and moved, > and can be initialized with a specific pixel format. This should be Linux > friendly since the platform implementation details are hidden. > > I don't expose any private variables in the class header, instead I handle > all of the platform specifics within the .cpp files using maps to associate > data with the interface classes as needed. In Win32 there is very little > that must be stored aside from the hwnd and hdc, just about everything else > can be queried from the Win32 API. > > I don't know enough about Direct3D to design for it, but OpenGL makes this > easy because my 3D context window can handle all wgl* specifics like > MakeCurrent and SwapBuffers, and otherwise I can just call OpenGL functions > anywhere in my code and the current context receives them automagically. > > YMMV, > Garett Bass > [email protected] > > > > ------------------------------------------------------- > 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_id=556