2003-05-26 22:25:23 +00:00
|
|
|
#ifndef RAGEDISPLAY_OGL_H
|
|
|
|
|
#define RAGEDISPLAY_OGL_H
|
|
|
|
|
|
|
|
|
|
class RageDisplay_OGL: public RageDisplay
|
|
|
|
|
{
|
|
|
|
|
public:
|
2003-06-25 20:44:49 +00:00
|
|
|
RageDisplay_OGL( VideoModeParams params, bool bAllowUnacceleratedRenderer );
|
2003-06-14 04:15:35 +00:00
|
|
|
virtual ~RageDisplay_OGL();
|
2003-05-26 22:25:23 +00:00
|
|
|
void Update(float fDeltaTime);
|
|
|
|
|
|
|
|
|
|
bool IsSoftwareRenderer();
|
|
|
|
|
void ResolutionChanged();
|
|
|
|
|
const PixelFormatDesc *GetPixelFormatDesc(PixelFormat pf) const;
|
|
|
|
|
|
|
|
|
|
void BeginFrame();
|
|
|
|
|
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 );
|
2003-11-29 17:56:09 +00:00
|
|
|
bool SupportsTextureFormat( PixelFormat pixfmt, bool realtime=false );
|
2003-10-09 06:33:11 +00:00
|
|
|
bool Supports4BitPalettes();
|
2003-07-15 23:55:56 +00:00
|
|
|
unsigned CreateTexture( PixelFormat pixfmt, SDL_Surface* img );
|
2003-05-26 22:25:23 +00:00
|
|
|
void UpdateTexture(
|
|
|
|
|
unsigned uTexHandle,
|
2003-06-29 08:13:18 +00:00
|
|
|
SDL_Surface* img,
|
2003-05-26 22:25:23 +00:00
|
|
|
int xoffset, int yoffset, int width, int height
|
|
|
|
|
);
|
|
|
|
|
void DeleteTexture( unsigned uTexHandle );
|
|
|
|
|
void SetTexture( RageTexture* pTexture );
|
|
|
|
|
void SetTextureModeModulate();
|
|
|
|
|
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
|
|
|
|
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 SetZTest( bool b );
|
2003-05-26 22:25:23 +00:00
|
|
|
void ClearZBuffer();
|
|
|
|
|
void SetBackfaceCull( bool b );
|
|
|
|
|
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
|
|
|
|
2004-01-06 19:54:13 +00:00
|
|
|
void SetSphereEnironmentMapping( bool b );
|
|
|
|
|
|
2003-07-07 01:29:18 +00:00
|
|
|
void DrawQuads( const RageSpriteVertex v[], int iNumVerts );
|
|
|
|
|
void DrawFan( const RageSpriteVertex v[], int iNumVerts );
|
|
|
|
|
void DrawStrip( const RageSpriteVertex v[], int iNumVerts );
|
|
|
|
|
void DrawTriangles( const RageSpriteVertex v[], int iNumVerts );
|
|
|
|
|
void DrawIndexedTriangles( const RageModelVertex v[], int iNumVerts, const Uint16* pIndices, int iNumIndices );
|
|
|
|
|
void DrawLineStrip( const RageSpriteVertex v[], int iNumVerts, float LineWidth );
|
2003-05-26 22:25:23 +00:00
|
|
|
|
2003-06-22 01:20:58 +00:00
|
|
|
CString GetTextureDiagnostics( unsigned id ) const;
|
|
|
|
|
|
2003-05-26 22:25:23 +00:00
|
|
|
void SaveScreenshot( CString sPath );
|
|
|
|
|
protected:
|
2003-08-27 23:36:09 +00:00
|
|
|
CString TryVideoMode( VideoModeParams params, bool &bNewDeviceOut );
|
2003-05-26 22:25:23 +00:00
|
|
|
void SetViewport(int shift_left, int shift_down);
|
|
|
|
|
RageMatrix GetOrthoMatrix( float l, float r, float b, float t, float zn, float zf );
|
2003-06-30 02:39:56 +00:00
|
|
|
PixelFormat GetImgPixelFormat( SDL_Surface* &img, bool &FreeImg, int width, int height );
|
2003-07-09 03:16:28 +00:00
|
|
|
bool SupportsSurfaceFormat( PixelFormat pixfmt );
|
2003-05-26 22:25:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|