Jump to content
  • Advertisement
Sign in to follow this  

getdc() GDI query PART 2

This topic is 5066 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to draw a rectangle in my game_main function, but I get the following error - error C2065: 'Getdc' : undeclared identifier It works in the pre-written examples I have, but in these it isn't used in a function so presumably I have to do something to have it recognised inside the game_main??? This is the game_main -
int Game_Main(void *parms = NULL, int num_parms = 0)

// Test if user is hitting ESC and send WM_CLOSE

// Draw rectangle
HWND hwnd;
//get DC
HDC hdc = Getdc(hwnd);
// create pen and brush
HPEN blue_pen = createpen(PS_SOLID, 1, RGB(0,0,255));
HBRUSH red_brush = createsolidbrush(RGB(255,0,0));
// select pen and brush into context
// draw rectangle
rectangle(hdc, 10,10, 20,20);

// return code

} // end Game_Main

Share this post

Link to post
Share on other sites
Thanks. I'm so used to VB.NET I forgot about case-sensitive C++!!!

It compiles and runs now, but no rectangle appearing???

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!