Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RageDisplay_OGL.h

Go to the documentation of this file.
00001 /* RageDisplay_OGL: OpenGL display implementation */ 00002 00003 #ifndef RAGEDISPLAY_OGL_H 00004 #define RAGEDISPLAY_OGL_H 00005 00006 class RageDisplay_OGL: public RageDisplay 00007 { 00008 public: 00009 RageDisplay_OGL(); 00010 virtual ~RageDisplay_OGL(); 00011 CString Init( VideoModeParams p, bool bAllowUnacceleratedRenderer ); 00012 void Update(float fDeltaTime); 00013 00014 bool IsSoftwareRenderer(); 00015 void ResolutionChanged(); 00016 const PixelFormatDesc *GetPixelFormatDesc(PixelFormat pf) const; 00017 00018 bool BeginFrame(); 00019 void EndFrame(); 00020 VideoModeParams GetVideoModeParams() const; 00021 void SetBlendMode( BlendMode mode ); 00022 bool SupportsTextureFormat( PixelFormat pixfmt, bool realtime=false ); 00023 unsigned CreateTexture( 00024 PixelFormat pixfmt, 00025 RageSurface* img, 00026 bool bGenerateMipMaps ); 00027 void UpdateTexture( 00028 unsigned uTexHandle, 00029 RageSurface* img, 00030 int xoffset, int yoffset, int width, int height 00031 ); 00032 void DeleteTexture( unsigned uTexHandle ); 00033 void ClearAllTextures(); 00034 int GetNumTextureUnits(); 00035 void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ); 00036 void SetTextureModeModulate(); 00037 void SetTextureModeGlow(); 00038 void SetTextureModeAdd(); 00039 void SetTextureWrapping( bool b ); 00040 int GetMaxTextureSize() const; 00041 void SetTextureFiltering( bool b); 00042 bool IsZWriteEnabled() const; 00043 bool IsZTestEnabled() const; 00044 void SetZWrite( bool b ); 00045 void SetZTestMode( ZTestMode mode ); 00046 void ClearZBuffer(); 00047 void SetCullMode( CullMode mode ); 00048 void SetAlphaTest( bool b ); 00049 void SetMaterial( 00050 const RageColor &emissive, 00051 const RageColor &ambient, 00052 const RageColor &diffuse, 00053 const RageColor &specular, 00054 float shininess 00055 ); 00056 void SetLighting( bool b ); 00057 void SetLightOff( int index ); 00058 void SetLightDirectional( 00059 int index, 00060 const RageColor &ambient, 00061 const RageColor &diffuse, 00062 const RageColor &specular, 00063 const RageVector3 &dir ); 00064 00065 void SetSphereEnvironmentMapping( bool b ); 00066 00067 RageCompiledGeometry* CreateCompiledGeometry(); 00068 void DeleteCompiledGeometry( RageCompiledGeometry* p ); 00069 00070 // hacks for cell-shaded models 00071 virtual void SetPolygonMode( PolygonMode pm ); 00072 virtual void SetLineWidth( float fWidth ); 00073 00074 CString GetTextureDiagnostics( unsigned id ) const; 00075 00076 protected: 00077 void DrawQuadsInternal( const RageSpriteVertex v[], int iNumVerts ); 00078 void DrawQuadStripInternal( const RageSpriteVertex v[], int iNumVerts ); 00079 void DrawFanInternal( const RageSpriteVertex v[], int iNumVerts ); 00080 void DrawStripInternal( const RageSpriteVertex v[], int iNumVerts ); 00081 void DrawTrianglesInternal( const RageSpriteVertex v[], int iNumVerts ); 00082 void DrawCompiledGeometryInternal( const RageCompiledGeometry *p, int iMeshIndex ); 00083 void DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float LineWidth ); 00084 00085 CString TryVideoMode( VideoModeParams params, bool &bNewDeviceOut ); 00086 RageSurface* CreateScreenshot(); 00087 void SetViewport(int shift_left, int shift_down); 00088 PixelFormat GetImgPixelFormat( RageSurface* &img, bool &FreeImg, int width, int height, bool bPalettedTexture ); 00089 bool SupportsSurfaceFormat( PixelFormat pixfmt ); 00090 00091 void SendCurrentMatrices(); 00092 }; 00093 00094 #endif 00095 00096 /* 00097 * Copyright (c) 2001-2004 Chris Danford, Glenn Maynard 00098 * All rights reserved. 00099 * 00100 * Permission is hereby granted, free of charge, to any person obtaining a 00101 * copy of this software and associated documentation files (the 00102 * "Software"), to deal in the Software without restriction, including 00103 * without limitation the rights to use, copy, modify, merge, publish, 00104 * distribute, and/or sell copies of the Software, and to permit persons to 00105 * whom the Software is furnished to do so, provided that the above 00106 * copyright notice(s) and this permission notice appear in all copies of 00107 * the Software and that both the above copyright notice(s) and this 00108 * permission notice appear in supporting documentation. 00109 * 00110 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00111 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00112 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00113 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00114 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00115 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00116 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00117 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00118 * PERFORMANCE OF THIS SOFTWARE. 00119 */ 00120

Generated on Thu Jan 27 20:57:27 2005 for StepMania by doxygen 1.3.7