🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AHHH!!!

Started by
4 comments, last by ettamme 24 years, 3 months ago
I cant get ANYTHING to work in the stupid GDI! I cant even draw a freekin circle! What stuff is absolutly necessary for making a gdi game? do you need to make an event handler and stuff? can you just creat the window and then draw in it?? or do you have to put a bunch of other crud in there? Help!!! ~Eric "there is beer coming from the chimney, code 3, I am proceeding on foot,i repeat bring pretzles."
"there is beer coming from the chimney, code 3, I am proceeding on foot,i repeat bring pretzles."
Advertisement
Yes, for a GDI game you NEED the gdi.

"When people tell you they want to hear the truth, you know that their lying."
You need the eventhandler to manage the window. But you don''t need it to draw in the window with GDI.

When you have no messages in the message queue and your application has some free time you can draw in the window with GDI.

Access the client area with GetDC(HWND), don''t forget to release it when you''re done with it.
I''m currently working on making a GDI library (cleverly titled "GDILib" ) and I will soon post info about it on my site (maybe today, maybe tomorrow, just whenever). Since GDI isn''t too complicated, I should have this thing working pretty soon.

Commander M
http://commanderm.8m.com
cmndrm@commanderm.8m.com
It just seems so jumbled to me, having to load and delete brushes and stuff. Where do you do the actuall drawing, you dont do it in the winproc do you?
"there is beer coming from the chimney, code 3, I am proceeding on foot,i repeat bring pretzles."
It''s a matter of preference, some people prefer to do the drawing when they get a WM_PAINT message. To do this you will need to call InvalidateRect() whenever the message queue is empty. InvalidateRect() tells Windows that the window needs updating, therefore Windows send a WM_PAINT to your window.

Other people prefer to do it directly in the message handling loop after checking to make sure the message queue is empty. (I prefer to do it this way)

For both of these cases you should call an external function with your drawing code, otherwise the code can easily get hard to read.

This topic is closed to new replies.

Advertisement