Files
itgmania212121/stepmania/src/RageDisplay_OGL.h
T

122 lines
4.3 KiB
C++
Raw Normal View History

2005-02-13 03:27:21 +00:00
/* RageDisplay_OGL: OpenGL renderer. */
2004-05-06 00:42:06 +00:00
2003-05-26 22:25:23 +00:00
#ifndef RAGEDISPLAY_OGL_H
#define RAGEDISPLAY_OGL_H
class RageDisplay_OGL: public RageDisplay
{
public:
2004-11-30 22:21:50 +00:00
RageDisplay_OGL();
2003-06-14 04:15:35 +00:00
virtual ~RageDisplay_OGL();
2004-11-30 22:21:50 +00:00
CString Init( VideoModeParams p, bool bAllowUnacceleratedRenderer );
2003-05-26 22:25:23 +00:00
void Update(float fDeltaTime);
bool IsSoftwareRenderer();
void ResolutionChanged();
const PixelFormatDesc *GetPixelFormatDesc(PixelFormat pf) const;
bool BeginFrame();
2003-05-26 22:25:23 +00:00
void EndFrame();
2003-06-05 19:29:27 +00:00
VideoModeParams GetVideoModeParams() const;
2003-05-26 22:25:23 +00:00
void SetBlendMode( BlendMode mode );
bool SupportsTextureFormat( PixelFormat pixfmt, bool realtime=false );
unsigned CreateTexture(
PixelFormat pixfmt,
2004-06-14 00:51:00 +00:00
RageSurface* img,
bool bGenerateMipMaps );
2003-05-26 22:25:23 +00:00
void UpdateTexture(
unsigned uTexHandle,
2004-06-14 00:51:00 +00:00
RageSurface* img,
2003-05-26 22:25:23 +00:00
int xoffset, int yoffset, int width, int height
);
void DeleteTexture( unsigned uTexHandle );
void ClearAllTextures();
2005-01-04 05:34:58 +00:00
int GetNumTextureUnits();
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
2003-05-26 22:25:23 +00:00
void SetTextureModeModulate();
2005-01-08 22:14:08 +00:00
void SetTextureModeGlow();
void SetTextureModeAdd();
2003-05-26 22:25:23 +00:00
void SetTextureWrapping( bool b );
int GetMaxTextureSize() const;
void SetTextureFiltering( bool b);
2003-11-18 20:33:18 +00:00
bool IsZWriteEnabled() const;
bool IsZTestEnabled() const;
void SetZWrite( bool b );
void SetZBias( float f );
2004-05-15 09:26:21 +00:00
void SetZTestMode( ZTestMode mode );
2003-05-26 22:25:23 +00:00
void ClearZBuffer();
2004-02-04 11:05:33 +00:00
void SetCullMode( CullMode mode );
2003-05-26 22:25:23 +00:00
void SetAlphaTest( bool b );
void SetMaterial(
2004-01-06 21:25:46 +00:00
const RageColor &emissive,
const RageColor &ambient,
const RageColor &diffuse,
const RageColor &specular,
2003-05-26 22:25:23 +00:00
float shininess
);
void SetLighting( bool b );
void SetLightOff( int index );
void SetLightDirectional(
int index,
2004-01-06 21:25:46 +00:00
const RageColor &ambient,
const RageColor &diffuse,
const RageColor &specular,
const RageVector3 &dir );
2003-05-26 22:25:23 +00:00
2005-01-22 03:39:39 +00:00
void SetSphereEnvironmentMapping( bool b );
2004-01-06 19:54:13 +00:00
RageCompiledGeometry* CreateCompiledGeometry();
void DeleteCompiledGeometry( RageCompiledGeometry* p );
// hacks for cell-shaded models
virtual void SetPolygonMode( PolygonMode pm );
2004-06-20 01:26:28 +00:00
virtual void SetLineWidth( float fWidth );
2003-06-22 01:20:58 +00:00
CString GetTextureDiagnostics( unsigned id ) const;
2003-05-26 22:25:23 +00:00
protected:
void DrawQuadsInternal( const RageSpriteVertex v[], int iNumVerts );
void DrawQuadStripInternal( const RageSpriteVertex v[], int iNumVerts );
void DrawFanInternal( const RageSpriteVertex v[], int iNumVerts );
void DrawStripInternal( const RageSpriteVertex v[], int iNumVerts );
void DrawTrianglesInternal( const RageSpriteVertex v[], int iNumVerts );
void DrawCompiledGeometryInternal( const RageCompiledGeometry *p, int iMeshIndex );
void DrawLineStripInternal( const RageSpriteVertex v[], int iNumVerts, float LineWidth );
CString TryVideoMode( VideoModeParams params, bool &bNewDeviceOut );
2004-06-14 00:51:00 +00:00
RageSurface* CreateScreenshot();
2003-05-26 22:25:23 +00:00
void SetViewport(int shift_left, int shift_down);
PixelFormat GetImgPixelFormat( RageSurface* &img, bool &FreeImg, int width, int height, bool bPalettedTexture );
bool SupportsSurfaceFormat( PixelFormat pixfmt );
void SendCurrentMatrices();
2003-05-26 22:25:23 +00:00
};
#endif
2004-05-06 00:42:06 +00:00
/*
* Copyright (c) 2001-2004 Chris Danford, Glenn Maynard
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/