http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

TheGrumpyProgrammer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Console Apps



> Hmm. That doesn't sound very interesting. I can see why nobody has any
> examples of this. I guess it isn't very useful for graphics after all. Oh
> well, back to my tangle of Windows stuff. Resistance IS futile :] . . .
> Currently I'm using DirectX's DirectDraw to get a block of memory for
> writing to manually (Using my own pixel routines as they tie in with the
> rest of the engine), and flip it onto the screen. I've been looking at
> OpenGL, and it seems to handle the Windows stuff much easier. I'm thinking
> about trying it out. Is there a way to simply obtain a pointer to the
"back
> surface" memory with OpenGL instead of using all of it's pre-set object
and
> 3D drawing functions? I'm not going to ask which is better in general (I
> get the idea that that might be a bad idea), but if I want to simply set
> pixel colours in memory (Doing all the calculations myself), which system
> would be able to do it with the most speed and simplicity.

You can only do that in DirectDraw, OpenGL doesn't return you the
backbuffer, but you can get there thru HDC and that kind of windows stuff.
Though DirectDraw is much easier in this regard. Just create the back and
front surface, and each frame lock the back buffer ** (be cautios about the
Pitch variable, becouse if you create a back buffer size like 640 in width,
it doesn't mean that it's really aligned like that so use like
(Y*DIRECTDRAWSURFACEDESC.Pitch), you get the structure when you lock the
surface ) ** fill it with your stuff and unlock it, flip it... It will work
out nicely. For better performance you could also make the Color conversion
tables, since you can't always know that your surface is 565 or 8888 or
something.

================
Ales Mlakar
(aka JaZzBrE, ICQ# 2168060)
JaZz=Life;     // Jazz is Life
================


=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html