Advertisement

Open Gl Problem...

Started by June 21, 2003 07:32 AM
10 comments, last by orcblood 21 years, 8 months ago
Okay, here comes another newbie asking some probably obvious questions about Open GL... I''ve read through the entire tutorials on "Using OpenGL in a window" or something like that. I must say that NeHe did a great job making the code clear and understandable . But whenever I try to compiler it (most of the errors I fixed - most were typos) it keeps giving me the error (with some others, syntax erors/undefined variables, etc) but this is the main one: error C2143: syntax error : missing '';'' before ''if'' This goes on for eseveral lines... I dont exactly know where I am missing the '';'' at... I didnt just copy/paste the code I tpyed it out so maybe its an error on my part, I dont know. Anyways, I was wondering if anyone knows how to fix this? Thanks alot, it will really help out a newbie. orcblood
Post some code... no way we can help you otherwise.
Advertisement
Okay, sorry about that I guess I should have thought ahead there... Anyways, heres the code - I probably have typed some things wrong or something like that... Anyways, Im going to modify it - my friend actually has a book on this stuff but he told me to read through nehe''s tuts first. Below is all of the source code - sorry for it being so damn long but I dont want to get one thing right and then have another go wrong. I should say thanks for any help right now - just so that no one copies/pastes it into the source - if your going to that is...

Thanks,
orcblood

//
// Header Files
//

#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>

//
// Program variables
//

HGLRC hRC = NULL;
HDC hDC = NULL;
HWND hWnd = NULL;
HINSTANCE hInstance = NULL;

//
// Arrays to monitor and keyboard
//

bool keys[256];
bool active = TRUE;
bool fullscreen = FALSE;

//
// Define the windows proc
//

LRESULT CALLBACK WndProc(HWND, UNIT, WPARAM, LPARAM);

//
// Resize the scene to that of the window
//

GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
{
if(height == 0)
{
height=1;
}

glViewport(0, 0, width, height);

//
// Set up the screen''s perspective
//

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

// the ratio of the window
gluPerspective(45.0f, (GLfloat)width/(GLfloat)height, 0.1f, 100.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

}

//
// Set up OpenGL
//

int InitGL(GLvoid)
{
gl_ShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

return TRUE;
}

//
// OpenGL Drawing section all OpenGL drawing code goes here
//

int DrawGLScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
return TRUE;
}

//
// Release the OpenGL window to release the rendering contex
//

GLvoid KillGLWindow(GLvoid)
{
// check for fullscreen mode
if(fullscreen)
{
ChangeDisplaySettings(NULL, 0);
ShowCursor(TRUE);
}

// check for rendering contex
if (hRC)
{
if (!wglMakeCurrent, NULL, NULL)
{
MessageBox(NULL, "An error occured while releasing the program from fullscreen mode.", "ERROR", MB_OK | MB_ICONINFORMATION);
}

// attempt to delete the rendering context
if (!wglDeleteContext(hRC))
{
MessageBox(NULL, "Releasing the rendering context failed.", "ERROR", MB_OK | MB_ICONINFORMATION);
}
}
hRC = NULL;
}

// check to see if the program still has a rendering context
if (hDC && !ReleaseDC(hWnd, hDC))
{
MessageBox(NULL, "Releasing the device context failed.", "ERROR", MB_OK | MB_ICONINFORMATION);
hDC = NULL;
}

// check to see if the window''s handle is still working
if (!hWnd && !DestroyWindow(hDC))
{
MessageBox(NULL, "Unable to release the window!", "ERROR", MB_OK | MN_ICONINFORMATION);
hWnd = NULL;
}

// unregister the window class
if (!UnregisterClass("OpenGL", hInstance))
{
MessageBox(NULL, "Unregistering the window''s class failed.", "ERROR", MB_OK | MB_ICONINFORMATION);
hInstance = NULL;
}

}

//
// Create the OpenGL window
//

BOOL CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)
{
GLunit PixelFormat;
WNDCLASS wc;
DWORD dwExStyle;
DWORD dwStyle;
RECT WindowRect;
WindowRect.left = (long)0;
WindowRect.right = (long)width;
WindowRect.top = (long)0;
WindowRect.bottom = (long)height;

fullscreen = fullscreenflag;

hInstance = GetModuleHandle(NULL);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDC_WINLOGO);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.lpszClassName = "OpenGL"

if (!RegisterClass(&wc))
{
MessageBox(NULL, "Failed to start the program.", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}

if (fullscreen)
{
DEVMODE dmScreenSettings;
memset (&dmScreenSettings, 0, sizeof(dmScreenSettings));
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
dmScreenSettings.dmPelsWidth = width;
dmScreenSettings.dmPelsHeight = height;
dmScreenSettings.dmBitsPerPel = bits;
dmScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;

if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
{
if (MessageBox(NULL, "Unable to switch into FullScreen Mode! Would you like to use WindowedMode instead?", "OrcishRendering", MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
fullscreen = FALSE;
}
else
{
MessageBox("The program will now close.", "OrcishRendering", MB_OK|MB_ICONSTOP);
return FALSE;
}
}
}

if (fullscreen)
{
dmExnostyle=WS_EX_APPWINDOW;
dmnostyle=WS_POPUP;
ShowCursor(FALSE);
}
else
{
dmExnostyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
dmExnostyle=WS_OVERLAPPEDWINDOW;
}

AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);

if (!hWnd=CreateWindowEx(
dwExStyle,
"OrcishRendering",
title,
WS_CLIPSIBLINGS |
WS_CLIPCHILDREN |
dwStyle,
0, 0,
WindowRect.right-WindowRect.left,
WindowRect.bottom-WindowRect.top,
NULL,
NULL,
hInstance,
NULL))

{
KillGLWindow();
MessageBox(NULL, "An error occured while the window was being created!", "ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE;
}

static PIXELFORMATSCRIPTOR pfd =
{
sizeof(PIXELFORMATSCRIPTOR),
1,
PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL |
PFD_TYPE_RGBA,
bits,
0, 0, 0, 0, 0, 0,
0,
0,
0,
0, 0, 0, 0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0
};

if (!(hDC=GetDC(hWnd)))
{
KillGLWindow();
MessageBox(NULL, "An error occured while creating the window!", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}

if (!(PixelFormat=ChoosePixelFormat(hDC, &pfd)))
{
KillGLWindow();
MessageBox(NULL, "An error occured while selecting a pixel format!", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}

if (!SetPixelFormat(hDC, PixelFormat, &pfd))
{
KillGLWindow();
MessageBox(NULL, "Unable to set a PixelFormat.", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}

if (!(hRC=wglCreateContext(hDC)))
{
KillGLWindow();
MessageBox(NULL, "An error occured while trying to set the RenderingContext.", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE
}

if (!wglMakeCurrent(hDC, hRC))
{
KillGLWindow();
MessageBox(NULL, "An error occured while trying to activate the OpenGL RenderingContext.", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}

ShowWindow(hWnd, SW_SHOW);
SetForegroundWindow(hWnd);
SetFocux(hWnd);
ResizeGLScene(width, height);

if (!InitGL())
{
KillGLWindow();
MessageBox(NULL, "An error occured while trying to initialize the program.", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}

return TRUE;
}

LRESULT CALLBACK WndProc ( HWND hWnd,
UNIT uMsg,
WPARAM wParam,
LPARAM lParam)
{
switch (uMsg)
case WM_ACTIVATE:
{
if (!HIWORD(wParam))
{
active = TRUE;
}
else
{
active = FALSE;
}

return 0;

}

case WS_COMMAND:
{
switch (wParam)
{
case SC_SCREENSAVE:
case SC_MONITORPOWER:
return 0;
}
break;
}

case WM_CLOSE:
{
PostQuitMessage(0);
return 0;
}

case WM_KEYDOWN:
{
keys[wParam]=TRUE;
return 0;
}

case WM_KEYUP:
{
keys[wParam]=FALSE;
return 0;
}

case WM_SIZE:
{
ResizeGLScene(LOWORD(lParam), HIWORD(lParam));
return 0;
}

}

return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)

{
MSG msg;
BOOL done=FALSE;


if (!CreateGLWindow("OrcishRendering", 640, 480, 16, FALSE)
{
return 0;
}

while (!done)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message==WM_QUIT)
{
done = TRUE;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
else
{
if (active)
{
if (keys[VK_ESCAPE])
{
done = TRUE;
}
else
{
DrawGLScene();
SwapBuffers(hDC);
}
}
if (keys[VK_F1])
{
keys[VK_F1]=FALSE;
KillGLWindow();
fullscreen=!fullscreen;
if (!CreateGLWindow("OrcishRendering", 640, 480, 16, FALSE))
{
return 0;
}
}
}
}
}

KillGLWindow();
return (msg.wParam);
}


Is had to read cos the code is not formated well in this
forum message but i think remove the clamp at:




if (fullscreen)
{
DEVMODE dmScreenSettings;
memset (&dmScreenSettings, 0, sizeof(dmScreenSettings));
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
dmScreenSettings.dmPelsWidth = width;
dmScreenSettings.dmPelsHeight = height;
dmScreenSettings.dmBitsPerPel = bits;
dmScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;

if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
{
if (MessageBox(NULL, "Unable to switch into FullScreen Mode! Would you like to use WindowedMode instead?", "OrcishRendering", MB_YESNO|MB_ICONEXCLAMATION)==IDYES)
fullscreen = FALSE;
}
else
{
MessageBox("The program will now close.", "OrcishRendering", MB_OK|MB_ICONSTOP);
return FALSE;
}
}
} <-- this one

hope it''s right !






use

[ source ]
MOO!
[ /source ]

except without the spaces in the tags, and you''ll get

MOO!





-~-The Cow of Darkness-~-

If you see the image I am online

Check out PGNet.tk
-~-The Cow of Darkness-~-
Sorry I thought that it might be but I wasnt sure. Anyways, I tried to remove that clamp and it didnt work... I get more errors now... Maybe I should just go out and buy a book.

Thanks,
orcblood

[edited by - orcblood on June 21, 2003 4:48:18 PM]
Advertisement
I see a place where you''re missing a '';'' before an ''if''. In the CreateGLWindow function about 15 lines down...

...
wc.lpszMenuName = NULL;
wc.lpszClassName = "OpenGL" <-----

if (!RegisterClass(&wc))
{
MessageBox(NULL, "Failed to start the program.", "ERROR", MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
....

I hope this helps.
Okay, I rewrote the code and now I only have 4 errors :D. Im pretty sure that their easy to fix - WinMain and WndProc errors mostly. I just dont want to mess anything up, so could anyone help me fix these errors?

Thanks, below is the code.
orcblood

/*Source code for the main window of OrcishRenderingBelow is the OpenGL code for:Initializing the window and setting up OpenGL,Opening and writing a .ms3d file into the assigned views,Rendering the .ms3d model in the Rendering Window.*///// Include Files//#include <windows.h>#include <gl\gl.h>#include <gl\glu.h>#include <gl\glaux.h>//// Handles and contexts//HDC	hDC = NULL;HGLRC	hRC = NULL;HWND	hWnd=NULL;HINSTANCE	hInstance;//// Flags and Arrays//bool	keys[256];bool	active = TRUE;bool	fullscreen = TRUE;//// Declair WinProc//LRESULT CALLBACK WndProc(HWND, UNIT, WPARAM, LPARAM);//// Resize the window and the OpenGL viewGLvoid ReSizeGLScene(GLsizei width, GLsizei height){	if (height == 0)	{		height = 1;	}		glViewport(0, 0, width, height);	glMatrixMode(GL_PROJECTION);	glLoadIdentity();	// calculate the ratio of the window	gluPerspective(45.0f, (GLfloat)width/(GLfloat)height, 0.1f, 100.0f);	glMatrixMode(GL_MODELVIEW);	glLoadIdentity();}int InitGL(GLvoid){	glShadeModel(GL_SMOOTH);	glClearColor(0.0f, 0.0f, 0.0f, 0.5f);	glClearDepth(1.0f);	glEnable(GL_DEPTH_TEST);	glDepthFunc(GL_LEQUAL);	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	return TRUE;}int DrawGLScene(GLvoid){	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	glLoadIdentity();	return TRUE;}GLvoid KillGLWindow(GLvoid){	if (fullscreen)	{		ChangeDisplaySettings(NULL, 0);		ShowCursor(TRUE);	}	if (hRC)	{		if(!wglMakeCurrent(NULL, NULL))		{			MessageBox(NULL, "Release of DC and RC failed, a shutdown error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONINFORMATION);		}			if (!wglDeleteContext(hRC))		{			MessageBox(NULL, "Reneasing the Rendering Context failed, a shutdown error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONINFORMATION);		}		hRC = NULL;	}	if (hDC && !ReleaseDC(hWnd, hDC))	{		MessageBox(NULL, "Releasing the Device Context failed, a shutdown error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONINFORMATION);		hDC = NULL;	}	if (hWnd && !DestroyWindow(hWnd))	{		MessageBox(NULL, "The Window Handle could not be released, a shutdown error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONINFORMATION);		hWnd = NULL;	}	if (!UnregisterClass("OpenGL", hInstance))	{		MessageBox(NULL, "The Window Handle could not be unregistered, a shutdown error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONINFORMATION);		hInstance = NULL;	}/*Create the OpenGL window''s parameterestitle, widht, height, bits, and the fullscreenflag.*/BOOL CreateGLWindow(char * title, int width, int height, int bits, bool fullscreenflag){	GLunit	PixelFormat;	WNDCLASS	wc;	DWORD	dwExStyle;	DWORD	dwStyle;	RECT	WindowRect;	WindowRect.left = (long)0;	WindowRect.right = (long)width;	WindowRect.top = (long)0;	WindowRect.bottom = (long)height;	fullscreen = fullscreenflag;	hInstance = GetModuleHandle(NULL);	wc.Style	= CS_HREDAW | CS_VREDAW | CS_OWNDC;	wc.lpfnWndProc	= (WNDPROC) WndProc;	wc.cbClsExtra	= 0;	wc.cbWndExtra	= 0;	wc.hInstance	= hInstance;	wc.Icon		= (HICON)LoadImage(hinstance,MAKEINTRESOURCE(IDI_PGRMICON),IMAGE_ICON,0,0,LR_DEFAULTSIZE);	wc.Cursor	= LoadCursor(NULL, IDC_ARROR);	wc.hbrBackground	= NULL;	wc.lpszMenuName  = "IDR_MAINMENU";	wc.lpszClassName	= "OpenGL";	if (!RegisterClass(&wc))	{		MessageBox(NULL, "Failure to Register the Window''s Class, an error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONEXCLAMATION);		return FALSE;	}	if (fullscreen)	{		DEVMODE dmScreenSettings;		memset (&dmScreenSettings, 0, sizeof(dmScreenSettings));		dmScreenSettings.dmSize = sizeof(dmScreenSettings);		dmScreenSettings.dmPelsWidth = width;		dmScreenSettings.dmPelsHeight = height;		dmScreenSettings.dmBitsPerPel = bits;		dmScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDHT|DM_PELSHEIGHT;	//	// try setting fullscreen mode	if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)	{		// if the change fails...		if (MessageBox(NULL, "An error occured while trying to switch to FullScreenMode.  Use windowed mode instead?", "OrcishRendering - Error", MB_YESNO|MB_ICONEXCLIMATION) == IDYES)		{			fullscreen = FALSE;		}		else		{			// tell the user that the program will now close			MessageBox(NULL, "The Program will not close.", "OrcishRendering - ERROR", MB_OK|MB_ICONSTOP);			return FALSE;		}	}}if (fullscreen){	dwExStyle = WS_EX_APPWINDOW;	dwStyle = WS_POPUP;	ShowCursor(FALSE);}else{dwExStyle = WS_EX_APPWINDOW|WS_EX_WINDOWEDGE;dwStyle = WS_OVERLAPPEDWINDOW;}AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);// create the windowif (!(hWnd = CreateWindowEX(				dwExStyle,				"OpenGL",				title, 				dwStyle|WS_CHIPSIBLINGS|WS_CHIPCHILDREN,				0,				0,				WindowRect.right-WindowRect.left,				WindowRect.bottom-WindowRect.top,				NULL,				wc.lpszMenuName  = "IDR_MAINMENU";,	// menu				hInstance,				NULL)))	{		KillGLWindow();		MessageBox(NULL, "An error occured while createing the window.", "OrcishRendering - ERROR", MB_OK|MB_ICONEXCLAMATION);		return FALSE;	}	static PIXELFORMATDESCRIPTOR pfd =	{		sizeof(PIXELFORMATDESCRIPTOR),		1,		PFD_DRAW_TO_WINDOW|		PFD_SUPPORT_OPENGL|		PFD_DOUBLEBUFFER,		PFD_TYPE_RGBA,		bits,		0, 0, 0, 0, 0, 0,		0,		0,		0,		0, 0, 0, 0,		16,		0,		0,		PFD_MAIN_PLANE,		0,		0, 0, 0	};	if (!(hDC = GetDC(hWnd)))	{		KillGLWindow();		MessageBox(NULL, "A Device Context could not be created.", "OrcishRendering - ERROR", MB_OK|MB_ICONEXCLAMATION);		return FALSE;	}	if (!(PixelFormat = ChoosePixelFormat(hDC, &pfd)))	{		KillGLWindow();		MessageBox(NULL, "A suitable PixelFormat could not be found.", "OrcishRendering - ERROR", MB_OK|MB_ICONEXCLAMATION);		return FALSE;	}	if(!SetPixelFormat(hDC, PixelFormat, &pfd))	{		KillGLWindow();		MessageBox(NULL, "Unable to set a Pixel Format.", "OrcishRendering - ERROR", MB_OK|MB)ICONEXCLAMATION);		return FALSE;	}	if (!(hRC = wglCreateContext(hDC)))	{		KillGLWindow();		MessageBox(NULL, "Unable to create a Rendering Context.", "OrcishRendering - ERROR", MB_OK|MB_ICONEXCLAMATION);		return FALSE;	}	if(!wglMakeCurrent(hDC, hRC))	{		KillGLWindow();		MessageBox(NULL, "Unable to activate the GL Rendering Context.", "OrcishRendering - ERROR", MB_OK|MB_ICONEXCLAMATION);		return FALSE;	}	ShowWindow(hWnd, SW_SHOW);	SetForegroundWindow(hWnd);							SetFocus(hWnd);										ReSizeGLScene(width, height);						if (!InitGL())										{		KillGLWindow();										MessageBox(NULL,"Initialization Failed.","ERROR",MB_OK|MB_ICONEXCLAMATION);		return FALSE;									}	return TRUE;									}LRESULT CALLBACK WndProc(	HWND	hWnd,										UINT	uMsg,										WPARAM	wParam,										LPARAM	lParam)			{	switch (uMsg)										{		case WM_ACTIVATE:									{			if (!HIWORD(wParam))								{				active=TRUE;									}			else			{				active=FALSE;									}			return 0;										}		case WM_SYSCOMMAND:									{			switch (wParam)										{				case SC_SCREENSAVE:									case SC_MONITORPOWER:								return 0;										}			break;											}		case WM_CLOSE:										{			PostQuitMessage(0);									return 0;										}		case WM_KEYDOWN:									{			keys[wParam] = TRUE;								return 0;										}		case WM_KEYUP:										{			keys[wParam] = FALSE;								return 0;										}		case WM_SIZE:										{			ReSizeGLScene(LOWORD(lParam),HIWORD(lParam));  			return 0;										}	}	return DefWindowProc(hWnd,uMsg,wParam,lParam);}int WINAPI WinMain(	HINSTANCE	hInstance,								HINSTANCE	hPrevInstance,							LPSTR		lpCmdLine,								int			nCmdShow)			{	MSG		msg;										BOOL	done=FALSE;										if (MessageBox(NULL,"Would You Like To Run In Fullscreen Mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)	{		fullscreen=FALSE;								}	// Create Our OpenGL Window	if (!CreateGLWindow("NeHe''s OpenGL Framework",640,480,16,fullscreen))	{		return 0;										}	while(!done)										{		if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))			{			if (msg.message==WM_QUIT)							{				done=TRUE;										}			else												{				TranslateMessage(&msg);								DispatchMessage(&msg);							}		}		else												{						if (active)											{				if (keys[VK_ESCAPE])								{					done=TRUE;										}				else												{					DrawGLScene();										SwapBuffers(hDC);								}			}			if (keys[VK_F1])									{				keys[VK_F1]=FALSE;									KillGLWindow();										fullscreen=!fullscreen;												if (!CreateGLWindow("NeHe''s OpenGL Framework",640,480,16,fullscreen))				{					return 0;										}			}		}	}		KillGLWindow();									return (msg.wParam);							}} 
Oh, yea I forgot the errors :D.

:\Windows\Desktop\OrcishProductions\OrcishRendering\WinMain.cpp(40) : error C2061: syntax error : identifier ''UNIT''
C:\Windows\Desktop\OrcishProductions\OrcishRendering\WinMain.cpp(128) : error C2601: ''CreateGLWindow'' : local function definitions are illegal
C:\Windows\Desktop\OrcishProductions\OrcishRendering\WinMain.cpp(298) : error C2601: ''WndProc'' : local function definitions are illegal
C:\Windows\Desktop\OrcishProductions\OrcishRendering\WinMain.cpp(358) : error C2601: ''WinMain'' : local function definitions are illegal

Thanks,
orcblood.
Change
LRESULT CALLBACK WndProc(HWND, UNIT, WPARAM, LPARAM);

to
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);


And change
if (!UnregisterClass("OpenGL", hInstance))	{		MessageBox(NULL, "The Window Handle could not be unregistered, a shutdown error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONINFORMATION);		hInstance = NULL;	}

to
if (!UnregisterClass("OpenGL", hInstance))	{		MessageBox(NULL, "The Window Handle could not be unregistered, a shutdown error has occured.", "OrcishRendering - ERROR", MB_OK|MB_ICONINFORMATION);		hInstance = NULL;	}}


After those changes are made, it should work...


Dillon

This topic is closed to new replies.

Advertisement