Archived

This topic is now archived and is closed to further replies.

LeNain

Getting DC with glut

Recommended Posts

LeNain    122
I''d like to get my rendering DC but i''m using the Glut, so there is no function included with it... I''d be happy to here a method to get the DC using Glut Thanks in advance

Share this post


Link to post
Share on other sites
thuned    122
device context? i have no idea what it is or does tho

life is unfair, take advantage of it.
UNMB2 - if the link doesn''t work, try clicking it

Share this post


Link to post
Share on other sites
Bad Monkey    145
Getting (or even knowing about) a device context goes against what GLUT was designed for... platform independent i/o for OpenGL apps.

Still, if you insist on grabbing hold of the device context, you can use the GDI function "GetDC(HWND hWnd)" , however to use that you need a way to get a handle to the window....

What would you want the DC for anyways? (remember kids, OpenGL and GDI don''t mix )

Share this post


Link to post
Share on other sites
Jallen    122
To get the DC of a GLUT window requires that you have the handle to the window (HWND). To get this you call the function GetForegroundWindow() which returns the HWND of the top window.

Then use GetDC(HWND) to get the device context of the window.

Jason A.

---
I write code.
DelphiGL (http://delphigl.cfxweb.net)

Share this post


Link to post
Share on other sites