/*************************************************************************** * Copyright (C) 2006 by Tom Hicks * * tomhicks@cse.buffalo.edu * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ //////////////////////////////////////////////////////////////////////////////// // // Module: x11.cpp // Author: Tom Hicks // Creation: 10-08-2006 // LastEdit: 10-08-2006 // Editors: Tom Hicks // // Purpose: // To implement the OpenArena SDK. // // Summary of Methods: // Global // -InitControls() // Loads the defaultPlayer's configuration. // -InitGL() // Initializes OpenGL and is responsible for loading textures. // -ResizeGLScene(GLsizei width, GLsizei height) // Resizes the viewport to the current size of the visible area of the window specified by width and height. // -KillGLWindow() // Closes the window. // -CreateGLWindow(string title, int width, int height, int bits, bool fullscreenflag) // Creates the window with the specified parameters. // -WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) // Main procedure. // -WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) // Window Procedure for the OpenGL window. // //////////////////////////////////////////////////////////////////////////////// #include "x11.h" #include "main.h" #include "version.h" void InitControls(OpenArena::EventManager* em) { if (!level.LoadConfig("my.cfg")) { level.LoadConfig(); } } void InitControls() { if (!level.LoadConfig("my.cfg")) level.LoadConfig(); } int InitGL(GLvoid) { level.LoadGLTextures(); glEnable(GL_TEXTURE_2D); glShadeModel(GL_SMOOTH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); /*lighting disabled temporarily glLightfv(GL_LIGHT1, GL_AMBIENT, level.LightAmbient); for(index=0; index