00001 /* 00002 CS Senior Project 2003 00003 Team : Leftfield 00004 Project : ModernWarfare 00005 Members : 00006 - Russ Christensen <rchriste@cs.utah.edu> 00007 - Todd Smith <tcsmith@cs.utah.edu> 00008 - Usit Duongsaa <duongsaa@cs.utah.edu> 00009 Copyright 2003 Russ Christensen, Usit Duongsaa, and Todd Smith. All rights reserved. 00010 00011 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 00012 00013 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 00014 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 00015 THIS SOFTWARE IS PROVIDED BY RUSS CHRISTENSEN, USIT DUONGSAA, AND TODD SMITH ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RUSS, USIT, TODD OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 */ 00017 00018 00024 #include "WinMainSelector.h" 00025 #if defined COMPILE_DEMOBASICS 00026 00027 #include "..\AEngine\AEngine.h" 00028 00029 namespace { 00030 int counter = 0; 00031 ATexture pic = NULL; 00032 00033 //------------------------------------------------------------------------------------ 00034 void init() 00035 { 00036 pic = load_texture("textures\\demos\\tank.tga"); 00037 } 00038 //------------------------------------------------------------------------------------ 00039 void update() 00040 { 00041 sys_showConsole(true); 00042 counter++; 00043 } 00044 //------------------------------------------------------------------------------------ 00045 void render() 00046 { 00047 if(counter%100==0) sys_console() << "Console Text : counter = " << counter << endl; 00048 00049 overlay_rect( Vec2D(0.2f,0.2f), Vec2D(0.3f,0.2f) ); 00050 overlay_text() << "Hello"; 00051 overlay_textOut( Vec2D(0.5f, 0.7f) ); 00052 00053 overlay_image( pic, Vec2D(0.75f, 0.5f), Vec2D(0.1f,0.3f) ); 00054 00055 // show mouse cursor when left mouse button is not held down 00056 if( !input_isMouseLBDown() ) 00057 { 00058 FLOAT x = input_getMouseX(), y = input_getMouseY(); 00059 overlay_image( pic, Vec2D(x,y), Vec2D(0.1f,0.1f) ); 00060 overlay_text() << "Mouse Position is " << x << " " << y; 00061 overlay_textOut( Vec2D(0.5f, 0.8f) ); 00062 } 00063 } 00064 } //end namespace 00065 //------------------------------------------------------------------------------------ 00066 INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR, INT ) 00067 { 00068 sys_init(hInst,800,600,32,false); 00069 sys_setInitFunc(init); 00070 sys_setUpdateFunc(update); 00071 sys_setRenderFunc(render); 00072 sys_go(); 00073 return 0; 00074 } 00075 //------------------------------------------------------------------------------------ 00076 #endif
1.3-rc2