Getting DC with glut

Started by
3 comments, last by LeNain 22 years, 9 months ago
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
Advertisement
I use glut and I may be able to help you if a knew what DC stands for

~Steve~
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
life is unfair, take advantage of it.UNMB2 - if the link doesn't work, try clicking it :)
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 )
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)
---I write code.DelphiGL (http://delphigl.cfxweb.net)

This topic is closed to new replies.

Advertisement