Al's Programming Resource Homepage  Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

main.cpp File Reference

#include <windows.h>
#include "shared.h"
#include "general.h"
#include "vector.h"
#include "vertex.h"
#include "quat.h"
#include "matrix.h"
#include "texture.h"
#include "locmath.h"
#include "polygon.h"
#include "object.h"
#include "camera.h"
#include "light.h"
#include "collision.h"
#include "winfuncs.h"
#include "glfont.c"
#include "mmgr.h"
#include "resource.rh"

Go to the source code of this file.

Functions

void InitGL (int Width, int Height)
void ReSizeGLScene (int Width, int Height)
void DrawGLScene (void)
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE, LPSTR, int)

Variables

HGLRC hRC
HDC hDC
HWND hWnd
RECT screen
PAINTSTRUCT ps
float pi = 3.141592
float radian = pi / 180
float epsilon = 0.05
bool key [256]
bool released_key [256]
int currentCamera = 0
int numCameras = 4
float step = 5.0
float lasttime
float multiplier
const int average = 20
float lastmultiplier [average]
int fps
int GL_LIGHT [8] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7}
int currentLight = 0
int numLights = 0
POLYGONpolygon = new POLYGON[12]
TEXTUREtexture = new TEXTURE[1]
CAMERAcamera = new CAMERA[numCameras + 1]
CAMERA LastCam
LIGHTlight = new LIGHT[numLights + 1]
float lightColor [3] = {1.0, 1.0, 1.0}
int DialogInUse = 0
int testint
float testfloat
char teststring [64]
GLFONT myFont


Function Documentation

void DrawGLScene void   
 

Definition at line 98 of file main.cpp.

References LIGHT::Apply(), CheckForCollision(), currentCamera, DrawCone(), DrawCube(), DrawGrid(), DrawLightSphere(), DrawSphere(), CollisionPacket::eRadius, fps, glFontBegin(), glFontEnd(), glFontTextOut(), numLights, OBJECT::Position, CollisionPacket::sourcePoint, testfloat, testint, teststring, CollisionPacket::velocity, VECTOR::x, VECTOR::y, and VECTOR::z.

Referenced by WinMain(), and WndProc().

00099 {
00100       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
00101 
00102     LastCam = camera[currentCamera];
00103     camera[currentCamera].Update();
00104 
00105     // initialize collision detection structure
00106     CollisionPacket cp;
00107     cp.eRadius.x = 1.0;
00108     cp.eRadius.y = 1.0;
00109     cp.eRadius.z = 1.0;
00110     cp.sourcePoint.x = LastCam.Position.x;
00111     cp.sourcePoint.y = LastCam.Position.y;
00112     cp.sourcePoint.z = LastCam.Position.z;
00113     cp.velocity.x = camera[currentCamera].Position.x - LastCam.Position.x;
00114     cp.velocity.y = camera[currentCamera].Position.y - LastCam.Position.y;
00115     cp.velocity.z = camera[currentCamera].Position.z - LastCam.Position.z;
00116 
00117     CheckForCollision(polygon, &camera[currentCamera].Position, &cp);
00118 
00119     camera[currentCamera].Apply();
00120 
00121     int loop;
00122     for(loop = 0; loop <= numLights; loop++)
00123         light[loop].Apply();
00124 /*
00125     // if the light sphere position is in view draw a small green sphere
00126     if(CheckClipPlanes(camera[currentCamera], light[currentLight].Position))
00127     {
00128         glPushMatrix();
00129         glLoadIdentity();
00130         DrawGreenSphere();
00131         glPopMatrix();
00132     }
00133 */    
00134     DrawLightSphere(light);
00135     DrawGrid();
00136     DrawCube(polygon, texture);
00137     DrawSphere();
00138     DrawCone();
00139 
00140 // Draw text
00141         glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA) ;
00142     glDisable(GL_LIGHTING);
00143     glColor3f(0.0, 1.0, 0.0);
00144     glEnable(GL_BLEND);
00145     glDisable(GL_DEPTH_TEST);
00146     glPushMatrix();
00147     glLoadIdentity();
00148     glFontBegin(&myFont);
00149     char text[256];
00150 
00151     glFontTextOut("Tutorial #7", -37, 27, -70);
00152 
00153     sprintf(text, "FPS = %d", fps);
00154     glFontTextOut(text, -52, 34, -100);
00155 
00156     sprintf(text, "Integer = %d", testint);
00157     glFontTextOut(text, -52, -30, -100);
00158 
00159     sprintf(text, "Float = %f", testfloat);
00160     glFontTextOut(text, -52, -32, -100);
00161 
00162     sprintf(text, "%s", "String = ");
00163     strcat(text, teststring);
00164     glFontTextOut(text, -52, -34, -100);
00165 
00166     glFontEnd();
00167     glPopMatrix();
00168     glEnable(GL_DEPTH_TEST);
00169         glDisable(GL_BLEND);
00170     glEnable(GL_LIGHTING);
00171 }

void InitGL int    Width,
int    Height
 

Definition at line 81 of file main.cpp.

References glFontCreate(), SetGLCamera(), SetGLLighting(), SetGLMaterial(), SetGLProperties(), SetGLTexture(), SetGLView(), and SetGLWorld().

Referenced by WndProc().

00082 {
00083     SetGLProperties();
00084     SetGLMaterial();
00085     SetGLView(Width, Height);
00086     SetGLLighting(light);
00087     SetGLWorld(polygon);
00088     SetGLTexture(texture);
00089     SetGLCamera(camera);
00090     glFontCreate(&myFont, "roman.glf", 2);    // create the font from the glf file
00091 }

void ReSizeGLScene int    Width,
int    Height
 

Definition at line 93 of file main.cpp.

References SetGLView().

Referenced by WndProc().

00094 {
00095     SetGLView(Width, Height);
00096 }

int WINAPI WinMain HINSTANCE    hInstance,
HINSTANCE   ,
LPSTR   ,
int   
 

Definition at line 322 of file main.cpp.

References average, currentCamera, currentLight, DialogInUse, DrawGLScene(), FALSE, GetLightColor(), GetTimePassed(), hDC, hRC, hWnd, key, lastmultiplier, lasttime, lightColor, multiplier, numCameras, numLights, released_key, screen, step, TRUE, and WndProc().

00326 {
00327     MSG        msg;
00328     WNDCLASSEX    wc;
00329 
00330     GetWindowRect(GetDesktopWindow(), &screen);
00331     wc.cbSize = sizeof(WNDCLASSEX);
00332     wc.style            = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_SAVEBITS;
00333     wc.lpfnWndProc        = (WNDPROC) WndProc;
00334     wc.cbClsExtra        = 0;
00335     wc.cbWndExtra        = 0;
00336     wc.hInstance        = hInstance;
00337     wc.hIcon            = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON));
00338     wc.hIconSm          = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON));
00339     wc.hCursor            = LoadCursor(NULL, IDC_ARROW);
00340     wc.hbrBackground    = NULL;
00341     wc.lpszMenuName        = NULL;
00342     wc.lpszClassName    = "OpenGL WinClass";
00343 
00344 
00345     if(!RegisterClassEx(&wc))
00346     {
00347         MessageBox(NULL,"Failed To Register The Window Class.","Error",MB_OK|MB_ICONERROR);
00348         return FALSE;
00349     }
00350 
00351     hWnd = CreateWindowEx(
00352     WS_EX_LEFT,
00353     "OpenGL WinClass",
00354     "OpenGL & Win32 Tutorial No.5",
00355 
00356     WS_MAXIMIZE |
00357     WS_CLIPCHILDREN |
00358     WS_CLIPSIBLINGS |
00359     WS_POPUPWINDOW |
00360     WS_VISIBLE,
00361     0, 0,
00362     screen.right, screen.bottom,
00363     NULL,
00364     NULL,
00365     hInstance,
00366     NULL);
00367 
00368     if(!hWnd)
00369     {
00370         MessageBox(NULL,"Window Creation Error.","Error",MB_OK|MB_ICONERROR);
00371         return FALSE;
00372     }
00373 
00374     DEVMODE dmScreenSettings;
00375 
00376     memset(&dmScreenSettings, 0, sizeof(DEVMODE));
00377     dmScreenSettings.dmSize        = sizeof(DEVMODE);
00378     dmScreenSettings.dmPelsWidth    = screen.right;
00379     dmScreenSettings.dmPelsHeight    = screen.bottom;
00380     dmScreenSettings.dmFields    = DM_PELSWIDTH | DM_PELSHEIGHT;
00381     ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);
00382 
00383     ShowWindow(hWnd, SW_HIDE);
00384     if(DialogBox(hInstance, "NAMEOFDLG", hWnd, (DLGPROC)NameOfProc) == IDOK) // calls the initialization dialog
00385     {
00386         ShowWindow(hWnd, SW_SHOW);
00387         UpdateWindow(hWnd);
00388         SetFocus(hWnd);
00389             wglMakeCurrent(hDC,hRC);
00390         SetCursorPos((int)(screen.right * 0.5), (int)(screen.bottom * 0.5));
00391         ShowCursor(0);
00392         }
00393     else
00394     {
00395         MessageBox(NULL,"Dialog Box Failed or You Cancelled It","Error",MB_OK|MB_ICONERROR);    
00396         delete[] texture;
00397         delete[] polygon;
00398         delete[] camera;
00399         delete[] light;
00400         PostQuitMessage(0);
00401     }
00402 
00403     while (1)
00404     {
00405         while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
00406         {
00407             if (GetMessage(&msg, NULL, 0, 0))
00408             {
00409                 TranslateMessage(&msg);
00410                 DispatchMessage(&msg);
00411             }
00412             else
00413             {
00414                 return TRUE;
00415             }
00416         }
00417 
00418         if(!DialogInUse)
00419         {
00420             SetCursorPos((int)(screen.right * 0.5), (int)(screen.bottom * 0.5));
00421             DrawGLScene();
00422             glFlush();
00423               SwapBuffers(hDC);
00424         }
00425 
00426         multiplier = GetTimePassed(lasttime, average, lastmultiplier);
00427         camera[currentCamera].Multiplier = multiplier;
00428         light[currentLight].Multiplier = multiplier;
00429 
00430         if (key['C'] && released_key['C'] == 0)
00431         {
00432             if (currentCamera < numCameras)
00433                 currentCamera++;
00434             else
00435                 currentCamera = 0;
00436             released_key['C'] = 1;
00437         }
00438 
00439         if (!key['C'])
00440             released_key['C'] = 0;
00441 
00442         if (key['L'] && released_key['L'] == 0)
00443         {
00444             if (currentLight < numLights)
00445                 currentLight++;
00446             else
00447                 currentLight = 0;
00448             released_key['L'] = 1;
00449         }
00450 
00451         if (!key['L'])
00452             released_key['L'] = 0;
00453 
00454         if (key['I'] && released_key['I'] == 0)
00455         {
00456             DialogInUse = 1;
00457             lightColor[0] = light[currentLight].Ambient[0];
00458             lightColor[1] = light[currentLight].Ambient[1];
00459             lightColor[2] = light[currentLight].Ambient[2];
00460             ShowCursor(1);
00461             GetLightColor();
00462             key['I'] = 0;
00463             ShowCursor(0);
00464             SetCursorPos((int)(screen.right * 0.5), (int)(screen.bottom * 0.5));
00465             light[currentLight].Ambient[0] = lightColor[0];
00466             light[currentLight].Ambient[1] = lightColor[1];
00467             light[currentLight].Ambient[2] = lightColor[2];
00468             light[currentLight].Update();
00469             DialogInUse = 0;
00470         }
00471 
00472         if (!key['I'])
00473             released_key['I'] = 0;
00474 
00475         if (key['O'] && released_key['O'] == 0)
00476         {
00477             DialogInUse = 2;
00478             lightColor[0] = light[currentLight].Diffuse[0];
00479             lightColor[1] = light[currentLight].Diffuse[1];
00480             lightColor[2] = light[currentLight].Diffuse[2];
00481             ShowCursor(1);
00482             GetLightColor();
00483             key['O'] = 0;
00484             ShowCursor(0);
00485             SetCursorPos((int)(screen.right * 0.5), (int)(screen.bottom * 0.5));
00486             light[currentLight].Diffuse[0] = lightColor[0];
00487             light[currentLight].Diffuse[1] = lightColor[1];
00488             light[currentLight].Diffuse[2] = lightColor[2];
00489             light[currentLight].Update();
00490             DialogInUse = 0;
00491         }
00492 
00493         if (!key['O'])
00494             released_key['O'] = 0;
00495 
00496         if (key['P'] && released_key['P'] == 0)
00497         {
00498             DialogInUse = 3;
00499             lightColor[0] = light[currentLight].Specular[0];
00500             lightColor[1] = light[currentLight].Specular[1];
00501             lightColor[2] = light[currentLight].Specular[2];
00502             ShowCursor(1);
00503             GetLightColor();
00504             key['P'] = 0;
00505             ShowCursor(0);
00506             SetCursorPos((int)(screen.right * 0.5), (int)(screen.bottom * 0.5));
00507             light[currentLight].Specular[0] = lightColor[0];
00508             light[currentLight].Specular[1] = lightColor[1];
00509             light[currentLight].Specular[2] = lightColor[2];
00510             light[currentLight].Update();
00511             DialogInUse = 0;
00512         }
00513 
00514         if (!key['P'])
00515             released_key['P'] = 0;
00516 
00517         if (key[49])
00518         {
00519             step = 1.0;
00520         }
00521 
00522         if (key[50])
00523         {
00524             step = 2.0;
00525         }
00526 
00527         if (key[51])
00528         {
00529             step = 3.0;
00530         }
00531 
00532         if (key[52])
00533         {
00534             step = 4.0;
00535         }
00536 
00537         if (key[53])
00538         {
00539             step = 5.0;
00540         }
00541 
00542         if (key[54])
00543         {
00544             step = 6.0;
00545         }
00546 
00547         if (key[55])
00548         {
00549             step = 7.0;
00550         }
00551 
00552         if (key[56])
00553         {
00554             step = 8.0;
00555         }
00556 
00557         if (key[57])
00558         {
00559             step = 9.0;
00560         }
00561 
00562         if (key[VK_NUMPAD6])
00563         {
00564             light[currentLight].Movement_x += step;
00565         }
00566 
00567         if (key[VK_NUMPAD4])
00568         {
00569             light[currentLight].Movement_x -= step;
00570         }
00571 
00572         if (key[VK_NUMPAD2])
00573         {
00574             light[currentLight].Movement_z += step;
00575         }
00576 
00577         if (key[VK_NUMPAD8])
00578         {
00579             light[currentLight].Movement_z -= step;
00580         }
00581 
00582         if (key[VK_NUMPAD7])
00583         {
00584             light[currentLight].Movement_y += step;
00585         }
00586 
00587         if (key[VK_NUMPAD9])
00588         {
00589             light[currentLight].Movement_y -= step;
00590         }
00591 
00592         if (key[VK_NUMPAD5] && released_key[VK_NUMPAD5] == 0)
00593         {
00594             if (light[currentLight].Positional == FALSE)
00595                 light[currentLight].Positional = TRUE;
00596             else
00597                 light[currentLight].Positional = FALSE;
00598             released_key[VK_NUMPAD5] = 1;
00599         }
00600 
00601         if (!key[VK_NUMPAD5])
00602             released_key[VK_NUMPAD5] = 0;
00603 
00604         if (key[VK_RIGHT])
00605         {
00606             camera[currentCamera].Movement_x += step;
00607         }
00608 
00609         if (key[VK_LEFT])
00610         {
00611             camera[currentCamera].Movement_x -= step;
00612         }
00613 
00614         if (key[VK_DOWN])
00615         {
00616             camera[currentCamera].Movement_z += step;
00617         }
00618 
00619         if (key[VK_UP])
00620         {
00621             camera[currentCamera].Movement_z -= step;
00622         }
00623 
00624         if (key[VK_PRIOR])
00625         {
00626             camera[currentCamera].Movement_y += step;
00627         }
00628 
00629         if (key[VK_NEXT])
00630         {
00631             camera[currentCamera].Movement_y -= step;
00632         }
00633 
00634         if (key[VK_SPACE])
00635         {
00636             camera[currentCamera].Reset();
00637         }
00638 
00639         if (key[VK_ESCAPE])
00640             SendMessage(hWnd,WM_CLOSE,0,0);
00641     }
00642 }

LRESULT CALLBACK WndProc HWND    hWnd,
UINT    message,
WPARAM    wParam,
LPARAM    lParam
 

Definition at line 173 of file main.cpp.

References currentCamera, DrawGLScene(), FALSE, glFontDestroy(), hDC, hRC, hWnd, InitGL(), key, ps, ReSizeGLScene(), screen, and TRUE.

Referenced by WinMain().

00177 {
00178     GLuint    PixelFormat;
00179     static    PIXELFORMATDESCRIPTOR pfd=
00180     {
00181            sizeof(PIXELFORMATDESCRIPTOR),
00182         1,
00183         PFD_DRAW_TO_WINDOW |
00184         PFD_SUPPORT_OPENGL |
00185         PFD_DOUBLEBUFFER,
00186         PFD_TYPE_RGBA,
00187         16,
00188         0, 0, 0, 0, 0, 0,
00189         0,
00190         0,
00191         0,
00192         0, 0, 0, 0,
00193         16,
00194         0,
00195         0,
00196         PFD_MAIN_PLANE,
00197         0,
00198         0, 0, 0
00199     };
00200 
00201 
00202     switch (message)
00203     {
00204         case WM_CREATE:
00205             hDC = GetDC(hWnd);
00206 
00207             PixelFormat = ChoosePixelFormat(hDC, &pfd);
00208 
00209             if (!PixelFormat)
00210             {
00211                    MessageBox(NULL,"Can't find a suitable PixelFormat.","Error",MB_OK|MB_ICONERROR);
00212                 PostQuitMessage(0);
00213                 break;
00214             }
00215 
00216             if(!SetPixelFormat(hDC,PixelFormat,&pfd))
00217             {
00218                 MessageBox(NULL,"Can't set the PixelFormat.","Error",MB_OK|MB_ICONERROR);
00219                 PostQuitMessage(0);
00220                 break;
00221             }
00222 
00223             hRC = wglCreateContext(hDC);
00224             if(!hRC)
00225             {
00226                 MessageBox(NULL,"Can't create a GL Rendering Context.","Error",MB_OK|MB_ICONERROR);
00227                 PostQuitMessage(0);
00228                 break;
00229             }
00230 
00231             if(!wglMakeCurrent(hDC, hRC))
00232             {
00233                 MessageBox(NULL,"Can't activate the GL Rendering Context.","Error",MB_OK|MB_ICONERROR);
00234                 PostQuitMessage(0);
00235                 break;
00236             }
00237             InitGL(screen.right, screen.bottom);
00238         break;
00239 
00240         case WM_SYSCOMMAND:
00241         {
00242             switch (wParam)
00243             {
00244                 case SC_SCREENSAVE:
00245                 case SC_MONITORPOWER:
00246                     return 0;
00247             }
00248             break;
00249         }
00250 
00251 // required when a dialog window is moved or resized
00252         if (DialogInUse)
00253         {
00254             case WM_PAINT:
00255                 BeginPaint(hWnd,&ps);
00256                 DrawGLScene();
00257                 glFlush();
00258                 SwapBuffers(hDC);
00259                 EndPaint(hWnd,&ps);
00260             break;
00261         }
00262 
00263         case WM_DESTROY:
00264         case WM_CLOSE:
00265             glFontDestroy(&myFont); // free fonts allocated memory         
00266         
00267             delete[] texture;
00268             delete[] polygon;
00269             delete[] camera;
00270             delete[] light;
00271             ChangeDisplaySettings(NULL, 0);
00272 
00273             wglMakeCurrent(hDC,NULL);
00274             wglDeleteContext(hRC);
00275             ReleaseDC(hWnd,hDC);
00276 
00277             PostQuitMessage(0);
00278         break;
00279 
00280         case WM_KEYDOWN:
00281             key[wParam] = TRUE;
00282         break;
00283 
00284         case WM_KEYUP:
00285             key[wParam] = FALSE;
00286         break;
00287 
00288         case WM_SIZE:
00289             SetCursorPos((int)(screen.right * 0.5), (int)(screen.bottom * 0.5));
00290             ReSizeGLScene(LOWORD(lParam),HIWORD(lParam));
00291         break;
00292 
00293         case WM_MOUSEMOVE:
00294             camera[currentCamera].Delta_x = float(HIWORD(lParam) - screen.bottom * 0.5) * 10;
00295             camera[currentCamera].Delta_y = float(LOWORD(lParam) - screen.right * 0.5) * 10;
00296         break;
00297 
00298         case WM_LBUTTONDOWN:
00299             camera[currentCamera].Delta_z = -120.0;
00300         break;
00301 
00302         case WM_RBUTTONDOWN:
00303             camera[currentCamera].Delta_z = 120.0;
00304         break;
00305 
00306         case WM_LBUTTONUP:
00307             if (wParam != MK_RBUTTON)
00308                 camera[currentCamera].Delta_z = 0.0;
00309         break;
00310 
00311         case WM_RBUTTONUP:
00312             if (wParam != MK_LBUTTON)
00313                 camera[currentCamera].Delta_z = 0.0;
00314         break;
00315 
00316         default:
00317             return (DefWindowProc(hWnd, message, wParam, lParam));
00318     }
00319 return (0);
00320 }


Variable Documentation

const int average = 20
 

Definition at line 49 of file main.cpp.

Referenced by GetTimePassed(), and WinMain().

CAMERA* camera = new CAMERA[numCameras + 1]
 

Definition at line 65 of file main.cpp.

Referenced by SetGLCamera().

int currentCamera = 0
 

Definition at line 42 of file main.cpp.

Referenced by DrawGLScene(), WinMain(), and WndProc().

int currentLight = 0
 

Definition at line 55 of file main.cpp.

Referenced by DrawLightSphere(), and WinMain().

int DialogInUse = 0
 

Definition at line 73 of file main.cpp.

Referenced by ColorDialogHook(), and WinMain().

float epsilon = 0.05
 

Definition at line 35 of file main.cpp.

int fps
 

Definition at line 51 of file main.cpp.

Referenced by DrawGLScene(), and GetTimePassed().

int GL_LIGHT[8] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7}
 

Definition at line 54 of file main.cpp.

HDC hDC [static]
 

Definition at line 27 of file main.cpp.

Referenced by WinMain(), and WndProc().

HGLRC hRC [static]
 

Definition at line 26 of file main.cpp.

Referenced by WinMain(), and WndProc().

HWND hWnd
 

Definition at line 28 of file main.cpp.

Referenced by GetLightColor(), WinMain(), and WndProc().

bool key[256]
 

Definition at line 38 of file main.cpp.

Referenced by WinMain(), and WndProc().

CAMERA LastCam
 

Definition at line 66 of file main.cpp.

float lastmultiplier[average]
 

Definition at line 50 of file main.cpp.

Referenced by GetTimePassed(), and WinMain().

float lasttime
 

Definition at line 47 of file main.cpp.

Referenced by GetTimePassed(), and WinMain().

LIGHT* light = new LIGHT[numLights + 1]
 

Definition at line 69 of file main.cpp.

Referenced by DrawLightSphere(), and SetGLLighting().

float lightColor[3] = {1.0, 1.0, 1.0}
 

Definition at line 70 of file main.cpp.

Referenced by GetLightColor(), and WinMain().

float multiplier
 

Definition at line 48 of file main.cpp.

Referenced by GetTimePassed(), and WinMain().

GLFONT myFont
 

Definition at line 79 of file main.cpp.

int numCameras = 4
 

Definition at line 43 of file main.cpp.

Referenced by SetGLCamera(), and WinMain().

int numLights = 0
 

Definition at line 56 of file main.cpp.

Referenced by DrawGLScene(), SetGLLighting(), and WinMain().

float pi = 3.141592
 

Definition at line 33 of file main.cpp.

Referenced by OBJECT::GetXUnit(), OBJECT::GetYUnit(), OBJECT::MoveX(), and OBJECT::MoveY().

POLYGON* polygon = new POLYGON[12]
 

Definition at line 59 of file main.cpp.

Referenced by CheckForCollision(), DrawCube(), and SetGLWorld().

PAINTSTRUCT ps
 

Definition at line 30 of file main.cpp.

Referenced by WndProc().

float radian = pi / 180
 

Definition at line 34 of file main.cpp.

Referenced by OBJECT::Rotate().

bool released_key[256]
 

Definition at line 39 of file main.cpp.

Referenced by WinMain().

RECT screen
 

Definition at line 29 of file main.cpp.

Referenced by WinMain(), and WndProc().

float step = 5.0
 

Definition at line 44 of file main.cpp.

Referenced by WinMain().

float testfloat
 

Definition at line 75 of file main.cpp.

Referenced by DrawGLScene(), and NameOfProc().

int testint
 

Definition at line 74 of file main.cpp.

Referenced by DrawGLScene(), and NameOfProc().

char teststring[64]
 

Definition at line 76 of file main.cpp.

Referenced by DrawGLScene(), and NameOfProc().

TEXTURE* texture = new TEXTURE[1]
 

Definition at line 62 of file main.cpp.

Referenced by DrawCube(), and SetGLTexture().


Generated on Fri Dec 23 05:17:02 2005 for Dialogs, Text & FPS by doxygen1.2.15