OPENGL noo--bee, fullscreen problems

This is a discussion on OPENGL noo--bee, fullscreen problems within the Game Programming forums, part of the General Programming Boards category; Here I have part of an OPENGL program that ultimately shows a triangle rotating...that isn't important. What is important is ...

  1. #1
    Shadow12345
    Guest

    OPENGL noo--bee, fullscreen problems

    Here I have part of an OPENGL program that ultimately shows a triangle rotating...that isn't important. What is important is the three errors I get in the block of following code...btw, it is for creating a fullscreen window:
    Code:
    	//fullscreen stuff needs to be done before the window is created otherwise weird things can happen!!!!
    	DEVMODE devModeScreen;
    	memset(&devModeScreen, 0, sizeof(devModeScreen));
    	devModeScreen.dmSize = sizeof(devModeScreen);
    	devModeScreen.dmPelsWidth = 1024;	//You are supposed to use the same width and height in the DEVMODE
    	devModeScreen.dmPelsHeight = 768;	//datastructure as when you actually create the window
    	devModeScreen.dmBitsPerPel = 16;	//This should probably be the same...currently my system is running in 16bbp
    										//so it seemed like a good idea to use 16
    
    	devModeScreen.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
    
    	if(ChangeDisplaySettings(&devModeScreen, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
    		fullScreen = false;
    
    	if(fullScreen) {
    		extendedWindowStyle = WS_EX_APPWINDOW;
    		windowStyle = WS_POPUP;
    		ShowCursor(false);
    	}
    	else {
    		extendedWindowStyle = NULL;
    		windowStyle = WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
    	}
    
    
    
    
    	hwnd = CreateWindowEx(NULL,	//window creation
    		"MyClass",
    		"The OPENGL windows application",
    		WS_OVERLAPPEDWINDOW | WS_VISIBLE | 
    		WS_SYSMENU | WS_CLIPCHILDREN |
    		WS_CLIPSIBLINGS,
    		100, 100,
    		1024, 768,
    		NULL,
    		NULL,
    		hInstance,
    		NULL);
    If you know any opengl the code should be easy to understand...my three errors are:
    --------------------Configuration: opengl - Win32 Debug--------------------
    Compiling...
    main.cpp
    C:\WINDOWS\Desktop\opengl\main.cpp(133) : error C2065: 'extendedWindowStyle' : undeclared identifier
    C:\WINDOWS\Desktop\opengl\main.cpp(134) : error C2065: 'windowStyle' : undeclared identifier
    Error executing cl.exe.

    opengl.exe - 2 error(s), 0 warning(s)

    well what do you know, only two errors, hot dog!

    Thanks if you can explain what I did wrong.

  2. #2
    no-one
    Guest
    did you declare

    extendedWindowStyle
    windowStyle

    anywhere?

    put this line at the top of the function

    DWORD extendedWindowStyle,windowStyle;

  3. #3
    Mr. Bitmap
    Guest
    Also, you don't have to switch fullscreen before you create the window I always switch to fullscreen after I've created the window

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL Depth Problems
    By drdroid in forum Game Programming
    Replies: 9
    Last Post: 06-20-2003, 10:23 AM
  2. More Problems with OpenGL and the Client Area
    By Niytaan in forum Windows Programming
    Replies: 2
    Last Post: 11-06-2002, 03:24 PM
  3. Problems Drawing OpenGL to the Client Area
    By Niytaan in forum Windows Programming
    Replies: 3
    Last Post: 10-27-2002, 07:15 PM
  4. OpenGL texture mapping problems.
    By KnightSword in forum Game Programming
    Replies: 2
    Last Post: 07-12-2002, 11:26 PM
  5. Problems with rotations with OpenGL and GLUT
    By darcome in forum Game Programming
    Replies: 13
    Last Post: 07-05-2002, 01:12 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21