View Full Version : C++ OpenGL In Win32 Frame, Help!
Novak002 12-20-2005, 11:40 PM Alright, my goal is to make a Win32 Frame/Window with a menu at the top, Just a basic file, edit.ect
And then for the rest of it to be opengl with a spinning cube.
I have programmed a window that does this, although it seems to take up 50% of my 3.8Ghz CPU. so its obvious i coded something screwy. so im just gonna redo it.
Im asking what would be the proper way to make opengl inside a win32 frame?
im pretty confused, so a example would help..But words are just as good.
And o ya, im using Win32 not MFC!.
Thanks guys!
|
|
Stevemeister
12-21-2005, 01:21 AM
post your message loop. sometimes improper use of accelerators and other
things used in a message loop can be processor hogs.
Novak002
12-21-2005, 02:16 AM
ya that was just it, i fixed it... Took me like an hour. Im pretty nooby so this feels like a big acomplishment for me, but when my game engine done, CGTalk will be the first to see it.
If anyones wondering this fixed it:
while (1)
{
while (WaitMessage())
{
while (PeekMessage(&Message, NULL, 0, 0, PM_NOREMOVE))
{
if (GetMessage(&Message, NULL, 0, 0))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
else
{
return Message.wParam;
}
DrawScenes();
glFinish();
SwapBuff(hDC);
}
}
}
}
montclaris
12-21-2005, 05:20 PM
Also, check this link. I found it helpfull to begin with OpenGL, and even later on :
http://nehe.gamedev.net/
Novak002
12-22-2005, 12:39 AM
One more thing, i know how to make dlls. but how would i put my voids or my resource.h in a dll and call it. I tryed the voids in a dll and i failed. i tryed putting my resource.h in a dll and everything compiled and had no problems but it didnt use my resource.h therefore their was no menu. If you could help that would be greatly apriciated. Thanks!
CGTalk Moderation
12-22-2005, 12:39 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.