2002-10-28 05:30:45 +00:00
|
|
|
#ifndef RAGEDISPLAY_H
|
|
|
|
|
#define RAGEDISPLAY_H
|
2002-05-20 08:59:37 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: RageDisplay
|
|
|
|
|
|
|
|
|
|
Desc: Wrapper around a D3D device. Also holds global vertex and index
|
|
|
|
|
buffers that dynamic geometry can use to render.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
2002-10-28 05:30:45 +00:00
|
|
|
class RageTexture;
|
2002-11-11 04:53:31 +00:00
|
|
|
struct RageMatrix;
|
|
|
|
|
struct RageVertex;
|
|
|
|
|
|
2002-10-28 05:30:45 +00:00
|
|
|
#include "RageTypes.h"
|
2002-09-15 03:13:21 +00:00
|
|
|
|
2002-11-12 09:29:46 +00:00
|
|
|
const int REFRESH_DEFAULT = 0;
|
2002-11-11 04:53:31 +00:00
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
class RageDisplay
|
|
|
|
|
{
|
2002-08-18 16:19:26 +00:00
|
|
|
friend class RageTexture;
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
public:
|
2002-11-12 09:29:46 +00:00
|
|
|
RageDisplay( bool windowed, int width, int height, int bpp, int rate, bool vsync );
|
2002-05-20 08:59:37 +00:00
|
|
|
~RageDisplay();
|
|
|
|
|
|
2002-11-12 09:29:46 +00:00
|
|
|
bool SetVideoMode( bool windowed, int width, int height, int bpp, int rate, bool vsync );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-11-11 04:53:31 +00:00
|
|
|
void Clear();
|
|
|
|
|
void Flip();
|
|
|
|
|
bool IsWindowed() const;
|
|
|
|
|
int GetWidth() const;
|
|
|
|
|
int GetHeight() const;
|
|
|
|
|
int GetBPP() const;
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-10-28 05:30:45 +00:00
|
|
|
void SetViewTransform( const RageMatrix* pMatrix );
|
|
|
|
|
void GetViewTransform( RageMatrix* pMatrixOut );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-08-18 16:19:26 +00:00
|
|
|
void ResetMatrixStack();
|
|
|
|
|
void PushMatrix();
|
|
|
|
|
void PopMatrix();
|
2002-08-29 21:30:16 +00:00
|
|
|
void Translate( float x, float y, float z );
|
|
|
|
|
void TranslateLocal( float x, float y, float z );
|
|
|
|
|
void Scale( float x, float y, float z );
|
|
|
|
|
void RotateX( float r );
|
|
|
|
|
void RotateY( float r );
|
|
|
|
|
void RotateZ( float r );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
void SetTexture( RageTexture* pTexture );
|
2002-11-12 00:51:27 +00:00
|
|
|
|
2002-11-11 04:53:31 +00:00
|
|
|
void SetTextureModeModulate();
|
|
|
|
|
void SetTextureModeGlow();
|
2002-08-13 23:26:46 +00:00
|
|
|
void SetBlendModeNormal();
|
|
|
|
|
void SetBlendModeAdd();
|
2002-11-12 01:25:03 +00:00
|
|
|
bool ZBufferEnabled() const;
|
2002-08-13 23:26:46 +00:00
|
|
|
void EnableZBuffer();
|
|
|
|
|
void DisableZBuffer();
|
2002-10-18 19:01:32 +00:00
|
|
|
void EnableTextureWrapping();
|
|
|
|
|
void DisableTextureWrapping();
|
2002-11-11 04:53:31 +00:00
|
|
|
|
|
|
|
|
void DrawQuad( const RageVertex v[4] ); // upper-left, upper-right, lower-left, lower-right
|
|
|
|
|
void DrawQuads( const RageVertex v[], int iNumVerts );
|
|
|
|
|
void DrawFan( const RageVertex v[], int iNumVerts );
|
|
|
|
|
void DrawStrip( const RageVertex v[], int iNumVerts );
|
2002-11-14 08:38:41 +00:00
|
|
|
void DrawLoop( const RageVertex v[], int iNumVerts, float LineWidth );
|
2002-11-11 04:53:31 +00:00
|
|
|
void FlushQueue();
|
|
|
|
|
|
|
|
|
|
int GetMaxTextureSize() const;
|
2002-11-15 08:01:34 +00:00
|
|
|
|
|
|
|
|
void EnterPerspective(float fov, bool preserve_loc = true);
|
|
|
|
|
void ExitPerspective();
|
|
|
|
|
void LookAt(const RageVector3 &Eye, const RageVector3 &At, const RageVector3 &Up);
|
2002-11-15 02:47:08 +00:00
|
|
|
|
2002-11-11 20:43:30 +00:00
|
|
|
/* Statistics */
|
|
|
|
|
int GetFPS() const;
|
|
|
|
|
int GetVPF() const;
|
|
|
|
|
int GetDPF() const;
|
|
|
|
|
|
2002-11-11 04:53:31 +00:00
|
|
|
protected:
|
|
|
|
|
void AddVerts( const RageVertex v[], int iNumVerts );
|
2002-11-12 00:51:27 +00:00
|
|
|
void SetBlendMode(int src, int dst);
|
2002-11-12 09:29:46 +00:00
|
|
|
void SetupOpenGL();
|
2002-11-12 20:39:08 +00:00
|
|
|
void SetupExtensions();
|
2002-11-15 08:01:34 +00:00
|
|
|
void SetViewport(int shift_left, int shift_down);
|
2002-05-20 08:59:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern RageDisplay* DISPLAY; // global and accessable from anywhere in our program
|
2002-10-28 05:30:45 +00:00
|
|
|
|
2002-11-16 07:11:05 +00:00
|
|
|
#endif
|