00001 #pragma once 00002 00003 #ifndef __D3D8RENDERWINDOW_H__ 00004 #define __D3D8RENDERWINDOW_H__ 00005 00006 // Precompiler options 00007 #include "OgreD3D8Prerequisites.h" 00008 00009 #include "OgreRenderWindow.h" 00010 #include "OgreD3D8Driver.h" 00011 00012 #include "OgreNoMemoryMacros.h" 00013 #include "d3dfont.h" 00014 #include "OgreMemoryMacros.h" 00015 00016 00017 namespace Ogre { 00018 00019 class D3D8RenderWindow : public RenderWindow 00020 { 00021 public: 00022 D3D8RenderWindow(); 00023 ~D3D8RenderWindow(); 00024 00025 void create( String name, int width, int height, int colourDepth, 00026 bool fullScreen, int left, int top, bool depthBuffer, void* miscParam, ... ); 00027 00028 void destroy(void); 00029 bool isActive() { return mActive; } 00030 bool isClosed() { return mClosed; } 00031 void reposition( int left, int top ) {} 00032 void resize( int width, int height ); 00033 void swapBuffers( bool waitForVSync = true ); 00034 HWND getWindowHandle() { return mHWnd; } 00035 HWND getParentWindowHandle() { return mParentHWnd; } 00036 00037 D3D8Driver* getDirectD3DDriver() { return mpD3DDriver; } 00038 LPDIRECT3DDEVICE8 getD3DDevice() { return mpD3DDevice; } 00039 00040 void outputText( int x, int ty, const String& text ); 00041 void getCustomAttribute( String name, void* pData ); 00044 void writeContentsToFile(const String& filename); 00045 00046 bool requiresTextureFlipping() const { return false; } 00047 00048 protected: 00049 HWND mHWnd; // Win32 Window handle 00050 HWND mParentHWnd; // Parent Win32 window handle 00051 bool mActive; // Is active i.e. visible 00052 bool mReady; // Is ready i.e. available for update 00053 bool mClosed; 00054 00055 static LRESULT CALLBACK WndProc( 00056 HWND hWnd, 00057 UINT uMsg, 00058 WPARAM wParam, 00059 LPARAM lParam ); 00060 00061 // ------------------------------------------------------- 00062 // DirectX-specific 00063 // ------------------------------------------------------- 00064 00065 // Pointer to D3DDriver encapsulating Direct3D driver 00066 D3D8Driver* mpD3DDriver; 00067 00068 // Pointer to the 3D device specific for this window 00069 LPDIRECT3DDEVICE8 mpD3DDevice; 00070 D3DPRESENT_PARAMETERS md3dpp; 00071 LPDIRECT3DSURFACE8 mpRenderSurface; 00072 LPDIRECT3DSURFACE8 mpRenderZBuffer; 00073 00074 // Method for dealing with resize / move & 3d library 00075 void WindowMovedOrResized(void); 00076 }; 00077 00078 } 00079 00080 #endif
Copyright © 2002 by The OGRE Team