2011-12-31 00:11:24 +00:00
|
|
|
#pragma once
|
|
|
|
|
2012-01-03 20:39:10 +00:00
|
|
|
#include <engine/graphics.h>
|
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
class CCommandBuffer
|
|
|
|
{
|
|
|
|
class CBuffer
|
|
|
|
{
|
|
|
|
unsigned char *m_pData;
|
|
|
|
unsigned m_Size;
|
|
|
|
unsigned m_Used;
|
|
|
|
public:
|
|
|
|
CBuffer(unsigned BufferSize)
|
|
|
|
{
|
|
|
|
m_Size = BufferSize;
|
|
|
|
m_pData = new unsigned char[m_Size];
|
|
|
|
m_Used = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
~CBuffer()
|
|
|
|
{
|
|
|
|
delete [] m_pData;
|
|
|
|
m_pData = 0x0;
|
|
|
|
m_Used = 0;
|
|
|
|
m_Size = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Reset()
|
|
|
|
{
|
|
|
|
m_Used = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void *Alloc(unsigned Requested)
|
|
|
|
{
|
|
|
|
if(Requested + m_Used > m_Size)
|
|
|
|
return 0;
|
|
|
|
void *pPtr = &m_pData[m_Used];
|
|
|
|
m_Used += Requested;
|
|
|
|
return pPtr;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char *DataPtr() { return m_pData; }
|
|
|
|
unsigned DataSize() { return m_Size; }
|
|
|
|
unsigned DataUsed() { return m_Used; }
|
|
|
|
};
|
|
|
|
|
2012-01-03 21:01:37 +00:00
|
|
|
public:
|
2011-12-31 00:11:24 +00:00
|
|
|
CBuffer m_CmdBuffer;
|
|
|
|
CBuffer m_DataBuffer;
|
2012-01-03 21:01:37 +00:00
|
|
|
|
2011-12-31 08:40:11 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAX_TEXTURES=1024*4,
|
|
|
|
};
|
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
enum
|
|
|
|
{
|
2012-01-03 20:39:10 +00:00
|
|
|
// commadn groups
|
|
|
|
CMDGROUP_CORE = 0, // commands that everyone has to implement
|
2012-10-06 21:31:02 +00:00
|
|
|
CMDGROUP_PLATFORM_OPENGL = 10000, // commands specific to a platform
|
|
|
|
CMDGROUP_PLATFORM_SDL = 20000,
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
//
|
2012-01-03 20:39:10 +00:00
|
|
|
CMD_NOP = CMDGROUP_CORE,
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
CMD_RUNBUFFER,
|
|
|
|
|
|
|
|
// syncronization
|
|
|
|
CMD_SIGNAL,
|
|
|
|
|
|
|
|
// texture commands
|
|
|
|
CMD_TEXTURE_CREATE,
|
|
|
|
CMD_TEXTURE_DESTROY,
|
2011-12-31 08:40:11 +00:00
|
|
|
CMD_TEXTURE_UPDATE,
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
// rendering
|
|
|
|
CMD_CLEAR,
|
|
|
|
CMD_RENDER,
|
|
|
|
|
|
|
|
// swap
|
|
|
|
CMD_SWAP,
|
2012-01-01 12:38:46 +00:00
|
|
|
|
2012-01-01 13:30:45 +00:00
|
|
|
// misc
|
2016-04-29 22:34:12 +00:00
|
|
|
CMD_VSYNC,
|
2012-01-01 12:38:46 +00:00
|
|
|
CMD_SCREENSHOT,
|
2012-01-01 13:30:45 +00:00
|
|
|
CMD_VIDEOMODES,
|
2016-04-30 15:59:58 +00:00
|
|
|
CMD_RESIZE,
|
2012-01-03 20:39:10 +00:00
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
};
|
|
|
|
|
2011-12-31 08:40:11 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
TEXFORMAT_INVALID = 0,
|
|
|
|
TEXFORMAT_RGB,
|
|
|
|
TEXFORMAT_RGBA,
|
|
|
|
TEXFORMAT_ALPHA,
|
2011-12-31 10:18:55 +00:00
|
|
|
|
|
|
|
TEXFLAG_NOMIPMAPS = 1,
|
2012-08-27 16:58:30 +00:00
|
|
|
TEXFLAG_COMPRESSED = 2,
|
2012-10-07 09:22:49 +00:00
|
|
|
TEXFLAG_QUALITY = 4,
|
2011-12-31 08:40:11 +00:00
|
|
|
};
|
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
//
|
|
|
|
PRIMTYPE_INVALID = 0,
|
2015-07-09 00:08:14 +00:00
|
|
|
PRIMTYPE_LINES,
|
2011-12-31 00:11:24 +00:00
|
|
|
PRIMTYPE_QUADS,
|
2015-03-31 11:35:18 +00:00
|
|
|
PRIMTYPE_TRIANGLES,
|
2011-12-31 00:11:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
BLEND_NONE = 0,
|
|
|
|
BLEND_ALPHA,
|
|
|
|
BLEND_ADDITIVE,
|
|
|
|
};
|
|
|
|
|
2012-01-08 00:47:53 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
WRAP_REPEAT = 0,
|
|
|
|
WRAP_CLAMP,
|
|
|
|
};
|
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
struct SPoint { float x, y, z; };
|
|
|
|
struct STexCoord { float u, v; };
|
|
|
|
struct SColor { float r, g, b, a; };
|
|
|
|
|
|
|
|
struct SVertex
|
|
|
|
{
|
|
|
|
SPoint m_Pos;
|
|
|
|
STexCoord m_Tex;
|
|
|
|
SColor m_Color;
|
2012-01-01 13:15:35 +00:00
|
|
|
};
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
struct SCommand
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SCommand(unsigned Cmd) : m_Cmd(Cmd), m_Size(0) {}
|
|
|
|
unsigned m_Cmd;
|
|
|
|
unsigned m_Size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SState
|
|
|
|
{
|
|
|
|
int m_BlendMode;
|
2012-01-08 00:47:53 +00:00
|
|
|
int m_WrapMode;
|
2011-12-31 00:11:24 +00:00
|
|
|
int m_Texture;
|
|
|
|
SPoint m_ScreenTL;
|
|
|
|
SPoint m_ScreenBR;
|
|
|
|
|
|
|
|
// clip
|
|
|
|
bool m_ClipEnable;
|
|
|
|
int m_ClipX;
|
|
|
|
int m_ClipY;
|
|
|
|
int m_ClipW;
|
|
|
|
int m_ClipH;
|
|
|
|
};
|
2015-07-09 00:08:14 +00:00
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
struct SCommand_Clear : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Clear() : SCommand(CMD_CLEAR) {}
|
|
|
|
SColor m_Color;
|
|
|
|
};
|
2015-07-09 00:08:14 +00:00
|
|
|
|
2011-12-31 09:04:46 +00:00
|
|
|
struct SCommand_Signal : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Signal() : SCommand(CMD_SIGNAL) {}
|
|
|
|
semaphore *m_pSemaphore;
|
|
|
|
};
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
struct SCommand_RunBuffer : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_RunBuffer() : SCommand(CMD_RUNBUFFER) {}
|
|
|
|
CCommandBuffer *m_pOtherBuffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SCommand_Render : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Render() : SCommand(CMD_RENDER) {}
|
|
|
|
SState m_State;
|
|
|
|
unsigned m_PrimType;
|
|
|
|
unsigned m_PrimCount;
|
2012-01-01 13:30:45 +00:00
|
|
|
SVertex *m_pVertices; // you should use the command buffer data to allocate vertices for this command
|
2011-12-31 00:11:24 +00:00
|
|
|
};
|
|
|
|
|
2012-01-01 12:38:46 +00:00
|
|
|
struct SCommand_Screenshot : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Screenshot() : SCommand(CMD_SCREENSHOT) {}
|
2012-01-01 13:15:35 +00:00
|
|
|
CImageInfo *m_pImage; // processor will fill this out, the one who adds this command must free the data as well
|
2012-01-01 12:38:46 +00:00
|
|
|
};
|
|
|
|
|
2012-01-01 13:30:45 +00:00
|
|
|
struct SCommand_VideoModes : public SCommand
|
|
|
|
{
|
2016-04-29 22:34:12 +00:00
|
|
|
SCommand_VideoModes() : SCommand(CMD_VIDEOMODES) {}
|
2012-01-01 13:30:45 +00:00
|
|
|
|
|
|
|
CVideoMode *m_pModes; // processor will fill this in
|
|
|
|
int m_MaxModes; // maximum of modes the processor can write to the m_pModes
|
|
|
|
int *m_pNumModes; // processor will write to this pointer
|
2015-08-24 20:46:28 +00:00
|
|
|
int m_Screen;
|
2012-01-01 13:30:45 +00:00
|
|
|
};
|
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
struct SCommand_Swap : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Swap() : SCommand(CMD_SWAP) {}
|
2012-01-06 13:12:49 +00:00
|
|
|
|
|
|
|
int m_Finish;
|
2011-12-31 00:11:24 +00:00
|
|
|
};
|
2011-12-31 08:40:11 +00:00
|
|
|
|
2016-04-29 22:34:12 +00:00
|
|
|
struct SCommand_VSync : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_VSync() : SCommand(CMD_VSYNC) {}
|
|
|
|
|
|
|
|
int m_VSync;
|
|
|
|
bool *m_pRetOk;
|
|
|
|
};
|
|
|
|
|
2016-04-30 15:59:58 +00:00
|
|
|
struct SCommand_Resize : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Resize() : SCommand(CMD_RESIZE) {}
|
|
|
|
|
|
|
|
int m_Width;
|
|
|
|
int m_Height;
|
|
|
|
};
|
|
|
|
|
2011-12-31 08:40:11 +00:00
|
|
|
struct SCommand_Texture_Create : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Texture_Create() : SCommand(CMD_TEXTURE_CREATE) {}
|
|
|
|
|
|
|
|
// texture information
|
|
|
|
int m_Slot;
|
|
|
|
|
|
|
|
int m_Width;
|
|
|
|
int m_Height;
|
2012-10-06 21:31:02 +00:00
|
|
|
int m_PixelSize;
|
2011-12-31 08:40:11 +00:00
|
|
|
int m_Format;
|
|
|
|
int m_StoreFormat;
|
2011-12-31 10:18:55 +00:00
|
|
|
int m_Flags;
|
2011-12-31 08:40:11 +00:00
|
|
|
void *m_pData; // will be freed by the command processor
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SCommand_Texture_Update : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Texture_Update() : SCommand(CMD_TEXTURE_UPDATE) {}
|
|
|
|
|
|
|
|
// texture information
|
|
|
|
int m_Slot;
|
|
|
|
|
|
|
|
int m_X;
|
|
|
|
int m_Y;
|
|
|
|
int m_Width;
|
|
|
|
int m_Height;
|
|
|
|
int m_Format;
|
|
|
|
void *m_pData; // will be freed by the command processor
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct SCommand_Texture_Destroy : public SCommand
|
|
|
|
{
|
|
|
|
SCommand_Texture_Destroy() : SCommand(CMD_TEXTURE_DESTROY) {}
|
|
|
|
|
|
|
|
// texture information
|
|
|
|
int m_Slot;
|
|
|
|
};
|
2015-07-09 00:08:14 +00:00
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
//
|
|
|
|
CCommandBuffer(unsigned CmdBufferSize, unsigned DataBufferSize)
|
|
|
|
: m_CmdBuffer(CmdBufferSize), m_DataBuffer(DataBufferSize)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void *AllocData(unsigned WantedSize)
|
|
|
|
{
|
|
|
|
return m_DataBuffer.Alloc(WantedSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<class T>
|
2012-01-03 21:01:37 +00:00
|
|
|
bool AddCommand(const T &Command)
|
2011-12-31 00:11:24 +00:00
|
|
|
{
|
2012-01-03 20:39:10 +00:00
|
|
|
// make sure that we don't do something stupid like ->AddCommand(&Cmd);
|
|
|
|
(void)static_cast<const SCommand *>(&Command);
|
|
|
|
|
|
|
|
// allocate and copy the command into the buffer
|
2011-12-31 00:11:24 +00:00
|
|
|
SCommand *pCmd = (SCommand *)m_CmdBuffer.Alloc(sizeof(Command));
|
|
|
|
if(!pCmd)
|
2012-01-03 21:01:37 +00:00
|
|
|
return false;
|
2011-12-31 00:11:24 +00:00
|
|
|
mem_copy(pCmd, &Command, sizeof(Command));
|
|
|
|
pCmd->m_Size = sizeof(Command);
|
2012-01-03 21:01:37 +00:00
|
|
|
return true;
|
2011-12-31 00:11:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SCommand *GetCommand(unsigned *pIndex)
|
|
|
|
{
|
|
|
|
if(*pIndex >= m_CmdBuffer.DataUsed())
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
SCommand *pCommand = (SCommand *)&m_CmdBuffer.DataPtr()[*pIndex];
|
|
|
|
*pIndex += pCommand->m_Size;
|
|
|
|
return pCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Reset()
|
|
|
|
{
|
|
|
|
m_CmdBuffer.Reset();
|
|
|
|
m_DataBuffer.Reset();
|
2012-01-03 21:01:37 +00:00
|
|
|
}
|
2011-12-31 00:11:24 +00:00
|
|
|
};
|
|
|
|
|
2012-01-03 20:39:10 +00:00
|
|
|
// interface for the graphics backend
|
|
|
|
// all these functions are called on the main thread
|
|
|
|
class IGraphicsBackend
|
2011-12-31 00:11:24 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-01-03 20:39:10 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
INITFLAG_FULLSCREEN = 1,
|
|
|
|
INITFLAG_VSYNC = 2,
|
|
|
|
INITFLAG_RESIZABLE = 4,
|
2012-06-27 09:46:11 +00:00
|
|
|
INITFLAG_BORDERLESS = 8,
|
2012-01-03 20:39:10 +00:00
|
|
|
};
|
2011-12-31 00:11:24 +00:00
|
|
|
|
2012-08-16 22:03:53 +00:00
|
|
|
virtual ~IGraphicsBackend() {}
|
|
|
|
|
2016-04-29 22:34:12 +00:00
|
|
|
virtual int Init(const char *pName, int *Screen, int *pWidth, int *pHeight, int FsaaSamples, int Flags, int *pDesktopWidth, int *pDesktopHeight) = 0;
|
2012-01-03 20:39:10 +00:00
|
|
|
virtual int Shutdown() = 0;
|
2011-12-31 00:11:24 +00:00
|
|
|
|
2012-10-06 21:31:02 +00:00
|
|
|
virtual int MemoryUsage() const = 0;
|
|
|
|
|
2016-04-29 22:34:12 +00:00
|
|
|
virtual int GetNumScreens() const = 0;
|
|
|
|
|
2012-01-03 20:39:10 +00:00
|
|
|
virtual void Minimize() = 0;
|
|
|
|
virtual void Maximize() = 0;
|
2016-04-29 19:07:10 +00:00
|
|
|
virtual bool Fullscreen(bool State) = 0;
|
2016-04-29 22:34:12 +00:00
|
|
|
virtual void SetWindowBordered(bool State) = 0;
|
|
|
|
virtual bool SetWindowScreen(int Index) = 0;
|
|
|
|
virtual int GetWindowScreen() = 0;
|
2012-01-03 20:39:10 +00:00
|
|
|
virtual int WindowActive() = 0;
|
|
|
|
virtual int WindowOpen() = 0;
|
2015-08-24 23:01:38 +00:00
|
|
|
virtual void SetWindowGrab(bool Grab) = 0;
|
2014-10-18 14:17:36 +00:00
|
|
|
virtual void NotifyWindow() = 0;
|
2012-01-01 13:15:35 +00:00
|
|
|
|
2012-01-03 20:39:10 +00:00
|
|
|
virtual void RunBuffer(CCommandBuffer *pBuffer) = 0;
|
|
|
|
virtual bool IsIdle() const = 0;
|
|
|
|
virtual void WaitForIdle() = 0;
|
2011-12-31 00:11:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CGraphics_Threaded : public IEngineGraphics
|
|
|
|
{
|
2012-01-03 21:01:37 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
NUM_CMDBUFFERS = 2,
|
|
|
|
|
|
|
|
MAX_VERTICES = 32*1024,
|
|
|
|
MAX_TEXTURES = 1024*4,
|
2015-07-09 00:08:14 +00:00
|
|
|
|
2012-01-03 21:01:37 +00:00
|
|
|
DRAWING_QUADS=1,
|
|
|
|
DRAWING_LINES=2
|
|
|
|
};
|
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
CCommandBuffer::SState m_State;
|
2012-01-03 20:39:10 +00:00
|
|
|
IGraphicsBackend *m_pBackend;
|
2011-12-31 00:11:24 +00:00
|
|
|
|
2012-01-03 21:01:37 +00:00
|
|
|
CCommandBuffer *m_apCommandBuffers[NUM_CMDBUFFERS];
|
2011-12-31 00:11:24 +00:00
|
|
|
CCommandBuffer *m_pCommandBuffer;
|
|
|
|
unsigned m_CurrentCommandBuffer;
|
|
|
|
|
|
|
|
//
|
|
|
|
class IStorage *m_pStorage;
|
|
|
|
class IConsole *m_pConsole;
|
|
|
|
|
|
|
|
CCommandBuffer::SVertex m_aVertices[MAX_VERTICES];
|
|
|
|
int m_NumVertices;
|
|
|
|
|
|
|
|
CCommandBuffer::SColor m_aColor[4];
|
|
|
|
CCommandBuffer::STexCoord m_aTexture[4];
|
|
|
|
|
|
|
|
bool m_RenderEnable;
|
|
|
|
|
|
|
|
float m_Rotation;
|
|
|
|
int m_Drawing;
|
|
|
|
bool m_DoScreenshot;
|
|
|
|
char m_aScreenshotName[128];
|
|
|
|
|
|
|
|
int m_InvalidTexture;
|
|
|
|
|
2012-10-06 21:31:02 +00:00
|
|
|
int m_aTextureIndices[MAX_TEXTURES];
|
2011-12-31 00:11:24 +00:00
|
|
|
int m_FirstFreeTexture;
|
|
|
|
int m_TextureMemoryUsage;
|
|
|
|
|
2012-01-01 13:15:35 +00:00
|
|
|
void FlushVertices();
|
2011-12-31 00:11:24 +00:00
|
|
|
void AddVertices(int Count);
|
2015-03-31 11:35:18 +00:00
|
|
|
void Rotate(const CCommandBuffer::SPoint &rCenter, CCommandBuffer::SVertex *pPoints, int NumPoints);
|
2011-12-31 00:11:24 +00:00
|
|
|
|
2012-01-01 13:15:35 +00:00
|
|
|
void KickCommandBuffer();
|
|
|
|
|
2011-12-31 13:00:49 +00:00
|
|
|
int IssueInit();
|
|
|
|
int InitWindow();
|
2011-12-31 00:11:24 +00:00
|
|
|
public:
|
|
|
|
CGraphics_Threaded();
|
|
|
|
|
|
|
|
virtual void ClipEnable(int x, int y, int w, int h);
|
|
|
|
virtual void ClipDisable();
|
|
|
|
|
|
|
|
virtual void BlendNone();
|
|
|
|
virtual void BlendNormal();
|
|
|
|
virtual void BlendAdditive();
|
|
|
|
|
2012-01-08 00:47:53 +00:00
|
|
|
virtual void WrapNormal();
|
|
|
|
virtual void WrapClamp();
|
|
|
|
|
2011-12-31 00:11:24 +00:00
|
|
|
virtual int MemoryUsage() const;
|
|
|
|
|
|
|
|
virtual void MapScreen(float TopLeftX, float TopLeftY, float BottomRightX, float BottomRightY);
|
|
|
|
virtual void GetScreen(float *pTopLeftX, float *pTopLeftY, float *pBottomRightX, float *pBottomRightY);
|
|
|
|
|
|
|
|
virtual void LinesBegin();
|
|
|
|
virtual void LinesEnd();
|
|
|
|
virtual void LinesDraw(const CLineItem *pArray, int Num);
|
|
|
|
|
|
|
|
virtual int UnloadTexture(int Index);
|
|
|
|
virtual int LoadTextureRaw(int Width, int Height, int Format, const void *pData, int StoreFormat, int Flags);
|
2011-12-31 08:40:11 +00:00
|
|
|
virtual int LoadTextureRawSub(int TextureID, int x, int y, int Width, int Height, int Format, const void *pData);
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
// simple uncompressed RGBA loaders
|
|
|
|
virtual int LoadTexture(const char *pFilename, int StorageType, int StoreFormat, int Flags);
|
|
|
|
virtual int LoadPNG(CImageInfo *pImg, const char *pFilename, int StorageType);
|
|
|
|
|
2014-01-19 03:02:01 +00:00
|
|
|
void ScreenshotDirect();
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
virtual void TextureSet(int TextureID);
|
|
|
|
|
|
|
|
virtual void Clear(float r, float g, float b);
|
|
|
|
|
|
|
|
virtual void QuadsBegin();
|
|
|
|
virtual void QuadsEnd();
|
|
|
|
virtual void QuadsSetRotation(float Angle);
|
|
|
|
|
|
|
|
virtual void SetColorVertex(const CColorVertex *pArray, int Num);
|
|
|
|
virtual void SetColor(float r, float g, float b, float a);
|
|
|
|
|
|
|
|
virtual void QuadsSetSubset(float TlU, float TlV, float BrU, float BrV);
|
|
|
|
virtual void QuadsSetSubsetFree(
|
|
|
|
float x0, float y0, float x1, float y1,
|
|
|
|
float x2, float y2, float x3, float y3);
|
|
|
|
|
|
|
|
virtual void QuadsDraw(CQuadItem *pArray, int Num);
|
|
|
|
virtual void QuadsDrawTL(const CQuadItem *pArray, int Num);
|
|
|
|
virtual void QuadsDrawFreeform(const CFreeformItem *pArray, int Num);
|
2012-10-14 12:04:48 +00:00
|
|
|
virtual void QuadsText(float x, float y, float Size, const char *pText);
|
2011-12-31 00:11:24 +00:00
|
|
|
|
2016-04-29 22:34:12 +00:00
|
|
|
virtual int GetNumScreens() const;
|
2011-12-31 00:11:24 +00:00
|
|
|
virtual void Minimize();
|
|
|
|
virtual void Maximize();
|
2016-04-29 19:07:10 +00:00
|
|
|
virtual bool Fullscreen(bool State);
|
2016-04-29 22:34:12 +00:00
|
|
|
virtual void SetWindowBordered(bool State);
|
|
|
|
virtual bool SetWindowScreen(int Index);
|
2016-04-30 15:59:58 +00:00
|
|
|
virtual void Resize(int w, int h);
|
2016-04-29 22:34:12 +00:00
|
|
|
virtual int GetWindowScreen();
|
2011-12-31 00:11:24 +00:00
|
|
|
|
|
|
|
virtual int WindowActive();
|
|
|
|
virtual int WindowOpen();
|
|
|
|
|
2015-08-24 23:01:38 +00:00
|
|
|
virtual void SetWindowGrab(bool Grab);
|
2014-10-18 14:17:36 +00:00
|
|
|
virtual void NotifyWindow();
|
|
|
|
|
2012-01-03 20:39:10 +00:00
|
|
|
virtual int Init();
|
2011-12-31 00:11:24 +00:00
|
|
|
virtual void Shutdown();
|
|
|
|
|
|
|
|
virtual void TakeScreenshot(const char *pFilename);
|
2014-01-19 03:02:01 +00:00
|
|
|
virtual void TakeCustomScreenshot(const char *pFilename);
|
2011-12-31 00:11:24 +00:00
|
|
|
virtual void Swap();
|
2016-04-29 22:34:12 +00:00
|
|
|
virtual bool SetVSync(bool State);
|
2011-12-31 00:11:24 +00:00
|
|
|
|
2015-08-24 20:46:28 +00:00
|
|
|
virtual int GetVideoModes(CVideoMode *pModes, int MaxModes, int Screen);
|
|
|
|
|
|
|
|
virtual int GetDesktopScreenWidth() { return m_DesktopScreenWidth; }
|
|
|
|
virtual int GetDesktopScreenHeight() { return m_DesktopScreenHeight; }
|
2011-12-31 00:11:24 +00:00
|
|
|
|
2011-12-31 09:04:46 +00:00
|
|
|
// syncronization
|
|
|
|
virtual void InsertSignal(semaphore *pSemaphore);
|
|
|
|
virtual bool IsIdle();
|
|
|
|
virtual void WaitForIdle();
|
2012-01-03 20:39:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern IGraphicsBackend *CreateGraphicsBackend();
|