00001 //#include "forcelib.h" 00002 00003 #include <windows.h> // Header File For Windows 00004 #include "glew.h" 00005 #include <gl\gl.h> // Header File For The OpenGL32 Library 00006 #include <gl\glu.h> // Header File For The GLu32 Library 00007 //#include <gl\glaux.h> // Header File For The Glaux Library 00008 #include "glut.h" 00009 #include <stdio.h> 00010 #include <io.h> 00011 #include <math.h> 00012 #include "tga.h" 00013 #include <time.h> 00014 00015 #include "TextData.h" 00016 #include "CDataClass.h" 00017 00018 00019 HDC hDC=NULL; // Private GDI Device Context 00020 HGLRC hRC=NULL; // Permanent Rendering Context 00021 HWND hWnd=NULL; // Holds Our Window Handle 00022 HINSTANCE hInstance; // Holds The Instance Of The Application 00023 00024 bool keys[256]; // Array Used For The Keyboard Routine 00025 bool active=TRUE; // Window Active Flag Set To TRUE By Default 00026 bool fullscreen=TRUE; // Fullscreen Flag Set To Fullscreen Mode By Default 00027 00028 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc 00029 00030 00031 //#ifndef WM_MOUSEWHEEL 00032 //#define WM_MOUSEWHEEL 0x020A 00033 //#endif 00034 #define WINDOW_WIDTH 1440 00035 #define WINDOW_HEIGHT 900 00036 #define ZNEAR 10.0f 00037 #define ZFAR 10000.0f 00038 #define HEIGHT_OF_FONT -15 00039 00040 //#define HAND_SAMPLE_TEST 00041 00042 int g_test; 00043 float fTempData = 0.0f; 00044 00045 int g_x; 00046 int g_y; 00047 float g_f; 00048 bool g_bIsRButtonDown; 00049 bool g_bIsLButtonDown; 00050 float g_fCameraPosX; 00051 float g_fCameraPosY; 00052 float g_fCameraPosZ; 00053 int g_nPrevMousePosX; 00054 int g_nPrevMousePosY; 00055 int g_nWidth; 00056 int g_nHeight; 00057 float g_fMouseSensitivity; 00058 float g_fCameraDistance; 00059 unsigned int g_uiTexture; 00060 00061 GLuint base; // Base Display List For The Font Set 00062 00063 GLhandleARB h_vertex; 00064 GLhandleARB h_frag; 00065 GLhandleARB h_program; 00066 00067 00068 CDataClass g_data; 00069 CTextList g_textList; 00070 CTextData g_fpsText; 00071 CTextData g_frameText; 00072 CTextData g_LogoText; 00073 00074 00075 LARGE_INTEGER g_Frequency; 00076 LARGE_INTEGER g_prevTick; 00077 LARGE_INTEGER g_curTick; 00078 double g_dTimeDuration; 00079 00080 00081 00082 void SetMaxHeight( float fData ); 00083 void SetPositiveToShader( bool bFlag ); 00084 void SetGlobalVarable(); 00085 int InitGL(GLvoid); 00086 char* SourceRead(char* filename); 00087 00088 // Font 00089 GLvoid BuildFont(GLvoid); 00090 GLvoid glPrint(const char *fmt, ...); 00091 GLvoid KillFont(GLvoid); 00092 GLvoid DrawText(); 00093 00094 00095 bool open_serial_port(); 00096 void close_serial_port(); 00097 void set_serial_data(); 00098 void loadconfigdata();