Jump to content
  • Advertisement
Sign in to follow this  
muimui1911

use GLUT & OpenGL together problem[everyone come in and help me please]

This topic is 4833 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

Hello everyone! I am trying to make a 3D environment with interactive control. the system should be able to use mouse and keyboard keys for viewing and walk in the environment. another thing that i need to do is to be able to insert any objects individually, where the objects have been converted from 3Dmax to openGL; so i wanna make a menu or button for activing this file import function. I know GLUT can create and set menus, but I am using WIN32 Application and i setup my program by "WINAPI winmain" and "LRESULT CALLBACK WndProc"; using "Windows Input Messages" for keyboard and mouse input. 1. summarizing the above conditions, would i still be able to use GLUT for create and set menu? What would the comment be? 2.will it be easier if i use GLUT functions for mouse and keyboard control and for the extension use of the interactive function? (i have done the keyboard and mouse by window input messages already) That is what i wanna ask so far, Thank you so so so much for helping me!!!!!!! any unclear matter plase ask me to explain. Millions of thanks~!!!!!!!!

Share this post


Link to post
Share on other sites
Advertisement
Quote:

1. summarizing the above conditions, would i still be able to use GLUT for create and set menu? What would the comment be?
GLUT menus are right click menus, not overhead menus like Win32.

That being said, Win32 and GLUT are pseudo-uncompatible. GLUT needs glutmainloop() to work, which means you'd have to port your win32 code to GLUT.

Quote:
2.will it be easier if i use GLUT functions for mouse and keyboard control and for the extension use of the interactive function?
If you already are using Win32 messages to obtain interaction, IMHO, it's a bad idea to rewrite working code unless you have some reason.

My suggestion is to keep plugging away with win32 since that's what you've decided on for this application. If there is a large advantage to change the framework of an application during your project, it's alright. But if you keep changing your mind and porting your project between frameworks, you'll end up with a poorly engineered project. If you don't like win32, change to another framework for the next project.

Share this post


Link to post
Share on other sites
WNDCLASS windowclass;
DWORD dwExstyle;
DWORD dwstyle;
RECT WindowRect;

WindowRect.left=(long)0;
WindowRect.right=(long)width;
WindowRect.top=(long)0;
WindowRect.bottom=(long)height;


hInstance = GetModuleHandle(NULL);

windowclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
windowclass.lpfnWndProc = (WNDPROC) WndProc;
windowclass.cbClsExtra = 0;
windowclass.cbWndExtra = 0;
windowclass.hInstance = hInstance;
windowclass.hIcon = LoadIcon(NULL, IDI_WINLOGO);
windowclass.hCursor = LoadCursor(NULL, IDC_ARROW);
windowclass.hbrBackground = NULL;
windowclass.lpszMenuName = NULL;
windowclass.lpszClassName = "OpenGL";
if (!RegisterClass(&windowclass)) {
MessageBox(NULL,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; }

dwExstyle=WS_EX_APPWINDOW;
dwstyle=WS_POPUP;

AdjustWindowRectEx(&WindowRect, dwstyle, FALSE, dwExstyle);


if (!(hWnd=CreateWindowEx(
dwExstyle,
"OpenGL",
title,
dwstyle |
WS_OVERLAPPEDWINDOW |WS_CLIPSIBLINGS |
WS_CLIPCHILDREN,
0, 0,
WindowRect.right-WindowRect.left, WindowRect.bottom-WindowRect.top,
NULL, NULL,
hInstance,
NULL)))
{
Quit_Window(); // Reset The Display
return FALSE; // Return FALSE
}




I can only get the border bar, with Max/Min and close function, it doesn't show the menu out, would you mind helping me??

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!