Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CToxiWindow.h

Go to the documentation of this file.
00001 
00009 /* 
00010         ---- Copyright (C) 2002  Jose Eduardo R. Mourão (eduardo_rdm@hotmail.com) ----
00011           
00012         This file is part of ToxiTea.
00013 
00014     ToxiTea is free software; you can redistribute it and/or modify
00015     it under the terms of the GNU General Public License as published by
00016     the Free Software Foundation; either version 2 of the License, or
00017     (at your option) any later version.
00018 
00019     ToxiTea is distributed in the hope that it will be useful,
00020     but WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022     GNU General Public License for more details.
00023 
00024     You should have received a copy of the GNU General Public License
00025     along with ToxiTea; if not, write to the Free Software
00026     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027 
00028         For more information and updates visit: 
00029         http://toxitea.sourceforge.net
00030         or mail to: eduardo_rdm@hotmail.com
00031 
00032         COMPILING AND/OR USING YOU ARE ACCEPTING ALL TERMS ABOVE.
00033         THIS LICENSE CAN BE CHANGED ANY TIME FOR ANY REASON WITHOUT NO COMMUNICATION.
00034 */
00035 
00040 #include "Generals.h"
00041 #include "CToxiTea.h"
00042 #include "CToxiRenderer.h"
00043 #include "CToxiGLRenderer.h"
00044 #include "CToxiD3DRenderer.h"
00045 
00046 #ifndef _CTOXIWINDOW_CLASS_
00047 #define _CTOXIWINDOW_CLASS_
00048 
00049 
00050 class TOXITEADLL_API CToxiWindow {
00051 public:
00052 
00054         CToxiRenderer *renderer;
00055         
00057         CToxiConfig windowConfig;
00058 
00060         CToxiWindow(CToxiConfig c,CToxiRenderer *renderer);
00061 
00063         CToxiWindow(char *title,int width,int height,
00064                 int bits,bool fullscreen,
00065                 bool autoStart,CToxiRenderer *renderer);
00066 
00068         CToxiWindow();
00069         
00071         ~CToxiWindow();
00072 
00074         bool setRenderer(CToxiConfig c,CToxiRenderer *renderer);
00075 
00077         void startRenderer();
00078         bool startWindow(CToxiConfig c,CToxiRenderer *renderer);
00079         bool setContext();
00080 
00082         static LRESULT CALLBACK WndProc(HWND hWnd, 
00083                                                                         UINT uMsg,
00084                                                                         WPARAM wParam,
00085                                                                         LPARAM lParam);
00086 private:
00087         
00089         int rendererType;
00090 
00092         bool _keys[256];
00093         
00094         static MSG msg;         // Messages
00095 
00097         char _wnd_toxi_class[22];
00098 
00100         void genClassName();
00101 
00103         static void changeDisplaySize(int width,int height,HWND hWnd);
00104 
00106         bool startMainLoop();
00107 
00109         bool createWindow();
00110 
00112         void killWindow();
00113         
00115         virtual void onKeyPress(int key);
00117         virtual void onMouseDown(int button,v2i *c);
00118         virtual void onMouseUp(int button,v2i *c);
00119         virtual void onMouseDown(v2i *c);
00120         virtual void onMouseUp(v2i *c);
00121         virtual void onMouseMove(v2i *c);
00122         virtual void onMouseDblClick(int button,v2i *c);
00123 
00124 };
00125 
00126 #endif

Generated on Mon Sep 23 23:07:01 2002 for ToxiTea by doxygen1.2.18