Krylar Administrator Posts: 502 From: MD, USA Registered: 03-05-2001 |
Johnny's up to it again He's kicked off the first part of an openGL series with a new article entitled "Step Into The Next Dimension with OpenGL (Part 1)". Thanks, Johnny! -Krylar ------------------ |
Johnny Member Posts: 16 From: California, USA Registered: 12-23-2001 |
Hey all, First off, incase you're wondering, I decided to stop my ASP series. I just got kinda bored with it and theres nothing else really to say. Now about the GL series. The first article gives you a basic orientation on some simple concepts relating to 3D. It also shows you how to create a GL-enabled Window. One thing in that article I'd like to stress is the seperation of the message loop and game loop. On MSDN the sample OpenGL application uses a GetMessage() loop, and translates/dispatches Windows messages every cycle, along with processing OpenGL rendering commands. VERY SLOW. Its best to check if there is a message to be recieved, and if there is, process messages, rather than doing it every cycle regardless. Also, my EnableGL function is fairly generic. If you'd like to be able to set the color depth to something other than 16 bits its best to have that as a function argument with EnableGL. Another thing I neglected to mention is how to change the resolution and go into full screen, which is something I'll do in future articles. The second article is already written and it shows you how to render vertices, do blending, transformations, ect. After this article you should know your way a bit around OpenGL (at least in terms of rendering simple objects). I should have thrown in depth sorting somewhere in this article (what with the blending and all) but I'll cover that in a later article as well. The third article teaches you how to render a solid cube (again, depth sorting would have helped a bit here) and also shows how to do texture mapping (in a very Win32-specific way, but I'm assuming you're on that platform anyway)! The fourth article I haven't written yet, but I want to fix a few ommisions from previous articles (depth sorting, full screen, ect), and I'd also like to talk about display lists. I'd also like to touch on lighting and fog (two features which OpenGL makes blissfully easy). Beyond that I'm thinking of covering things like collision detection, Wavefront OBJ file loading and rendering (I'd choose OBJ format for this series because of simplicity), mip mapping, font engines, and possibly BSP map loading and rendering (BSP trees are easy, basically linked lists with multiple nodes branching out instead of one). If theres anything else you'd like me to add onto this list please tell me here or at jwatson@thecrazyones.com. Also, krylar, whenever I include something it gets parsed as a tag in the web browser. You can find out the convention for fixing that here: http://hotwired.lycos.com/webmonkey/reference/special_characters/ God bless, |
Imsold4christ Member Posts: 305 From: Gresham, OR, US Registered: 01-20-2001 |
Heh, I guess that means I'm off the "Latest article additions" list now. Oh well. I may come out with another high-quality Christian article in a few months or so. Not too many other people making Christian articles lately I've noticed. Well, I guess Revelator still has his flash thingys he's making, right? I still haven't looked at all of those. I think it'd be cool if we could get an article on worship. Well, nobody feel bad for not making a Christian article lately. There are hordes of good Christian reading on other sites. †Caleb† ------------------ |
Krylar Administrator Posts: 502 From: MD, USA Registered: 03-05-2001 |
Also, keep in mind that this is a programming site. So while specifically Christian articles are *great* to have, and I would never turn one away or attempt to disuade having them!...we also need to keep putting up the programming stuff too -Krylar ------------------ |
Johnny Member Posts: 16 From: California, USA Registered: 12-23-2001 |
As I said earlier, I forgot to show how to do fullscreen. Its really quite simple. You create DEVMODE object, sets its properties, and use ChangeDisplaySettings like so. For example: //CDS_FULLSCREEN wont work on Dev-C++, so we put this here: DEVMODE dmGameSettings; ZeroMemory(&dmGameSettings,sizeof(dmGameSettings)); dmGameSettings.dmSize=sizeof(dmGameSettings); if(ChangeDisplaySettings(&dmGameSettings,CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) And to set our users desktop display mode back: ChangeDisplaySettings(NULL,0); ChangeDisplaySettings() is a Win32-specific function. OpenGL does not contain any functions for setting the display mode, so it relies on platform specific routines to handle it for us. Note that you'll need to change the Window style simply to WS_POPUP to get rid of the blue bar at top. Also know that we don't have any coop-mode changing functions like in DirectDraw, so the cooperative level of our application and Windows hasn't changed (for example, we can still use CTRL+ALT+DEL or ALT+F4). Well, glad I cleared that up. For more information on ChangeDisplaySettings, go here: [URL=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_7gz7.asp]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_7gz7.asp[/UR L] Good day, EDIT - A few mistakes in my code, sorry folks. [This message has been edited by Johnny (edited March 30, 2002).] |