38 void Set(
const std::vector<msMesh>& vMeshes,
bool bNeedsNormals);
40 virtual void Allocate(
const std::vector<msMesh>& vMeshes) = 0;
41 virtual void Change(
const std::vector<msMesh>& vMeshes) = 0;
45 virtual void Draw(
int iMeshIndex)
const = 0;
48 [[nodiscard]]
auto GetTotalVertices()
const ->
size_t
50 if (m_vMeshInfo.empty()) {
53 return m_vMeshInfo.back().iVertexStart +
54 m_vMeshInfo.back().iVertexCount;
56 [[nodiscard]]
auto GetTotalTriangles()
const ->
size_t
58 if (m_vMeshInfo.empty()) {
61 return m_vMeshInfo.back().iTriangleStart +
62 m_vMeshInfo.back().iTriangleCount;
71 bool m_bNeedsTextureMatrixScale;
73 std::vector<MeshInfo> m_vMeshInfo;
74 bool m_bNeedsNormals{};
75 bool m_bAnyNeedsTextureMatrixScale{};
106 std::string sDisplayId_,
114 bool bTrilinearFiltering_,
115 bool bAnisotropicFiltering_,
116 bool bWindowIsFullscreenBorderless_,
117 std::string sWindowTitle_,
118 std::string sIconFile_,
120 float fDisplayAspectRatio_)
121 : windowed(windowed_)
122 , sDisplayId(std::move(sDisplayId_))
128 , interlaced(interlaced_)
129 , bSmoothLines(bSmoothLines_)
130 , bTrilinearFiltering(bTrilinearFiltering_)
131 , bAnisotropicFiltering(bAnisotropicFiltering_)
132 , bWindowIsFullscreenBorderless(bWindowIsFullscreenBorderless_)
133 , sWindowTitle(std::move(sWindowTitle_))
134 , sIconFile(std::move(sIconFile_))
136 , fDisplayAspectRatio(fDisplayAspectRatio_)
141 : windowed(other.windowed)
142 , sDisplayId(other.sDisplayId)
144 , height(other.height)
148 , interlaced(other.interlaced)
149 , bSmoothLines(other.bSmoothLines)
150 , bTrilinearFiltering(other.bTrilinearFiltering)
151 , bAnisotropicFiltering(other.bAnisotropicFiltering)
152 , bWindowIsFullscreenBorderless(other.bWindowIsFullscreenBorderless)
153 , sWindowTitle(other.sWindowTitle)
154 , sIconFile(other.sIconFile)
156 , fDisplayAspectRatio(other.fDisplayAspectRatio)
161 : windowed(other.windowed)
162 , sDisplayId(std::move(other.sDisplayId))
164 , height(other.height)
168 , interlaced(other.interlaced)
169 , bSmoothLines(other.bSmoothLines)
170 , bTrilinearFiltering(other.bTrilinearFiltering)
171 , bAnisotropicFiltering(other.bAnisotropicFiltering)
172 , bWindowIsFullscreenBorderless(other.bWindowIsFullscreenBorderless)
173 , sWindowTitle(std::move(other.sWindowTitle))
174 , sIconFile(std::move(other.sIconFile))
176 , fDisplayAspectRatio(other.fDisplayAspectRatio)
183 bool windowed{
false };
184 std::string sDisplayId;
190 bool interlaced{
false };
191 bool bSmoothLines{
false };
192 bool bTrilinearFiltering{
false };
193 bool bAnisotropicFiltering{
false };
194 bool bWindowIsFullscreenBorderless{
false };
195 std::string sWindowTitle;
196 std::string sIconFile;
198 float fDisplayAspectRatio{ 0.0F };
276 unsigned int masks[4];
279 [[nodiscard]]
virtual auto GetPixelFormatDesc(RagePixelFormat pf)
const
286 bool bAllowUnacceleratedRenderer) -> std::string = 0;
288 [[nodiscard]]
virtual auto GetApiDescription() const -> std::
string = 0;
289 virtual
void GetDisplaySpecs(DisplaySpecs& out) const = 0;
291 void SetPresentTime(std::chrono::nanoseconds presentTime);
300 virtual
void ResolutionChanged();
301 auto IsD3D() ->
bool;
303 virtual auto BeginFrame() ->
bool;
304 virtual
void EndFrame();
305 [[nodiscard]] virtual auto GetActualVideoModeParams() const
307 auto IsWindowed() ->
bool {
return (*GetActualVideoModeParams()).windowed; }
309 auto GetFrameTimingAdjustment(std::chrono::steady_clock::time_point now)
312 virtual void SetBlendMode(BlendMode mode) = 0;
314 virtual auto SupportsTextureFormat(RagePixelFormat pixfmt,
315 bool realtime =
false) ->
bool = 0;
316 virtual auto SupportsThreadedRendering() ->
bool {
return false; }
317 virtual auto SupportsPerVertexMatrixScale() ->
bool = 0;
321 virtual void BeginConcurrentRenderingMainThread() {}
322 virtual void EndConcurrentRenderingMainThread() {}
323 virtual void BeginConcurrentRendering();
324 virtual void EndConcurrentRendering() {}
328 virtual auto CreateTexture(
329 RagePixelFormat pixfmt,
331 bool bGenerateMipMaps) -> intptr_t = 0;
332 virtual void UpdateTexture(intptr_t iTexHandle,
338 virtual void DeleteTexture(intptr_t iTexHandle) = 0;
341 virtual auto CreateTextureLock() ->
RageTextureLock* {
return nullptr; }
342 virtual void ClearAllTextures() = 0;
343 virtual auto GetNumTextureUnits() ->
int = 0;
344 virtual void SetTexture(TextureUnit, intptr_t ) = 0;
345 virtual void SetTextureMode(TextureUnit, TextureMode) = 0;
346 virtual void SetTextureWrapping(TextureUnit,
bool) = 0;
347 [[nodiscard]]
virtual auto GetMaxTextureSize() const ->
int = 0;
348 virtual
void SetTextureFiltering(TextureUnit,
bool) = 0;
349 virtual
void SetEffectMode(EffectMode ) {}
350 virtual auto IsEffectModeSupported(EffectMode effect) ->
bool
352 return effect == EffectMode_Normal;
355 [[nodiscard]]
virtual auto SupportsRenderToTexture() const ->
bool
359 [[nodiscard]]
virtual auto SupportsFullscreenBorderlessWindow() const
378 virtual auto GetRenderTarget() -> intptr_t {
return 0; }
386 virtual void SetRenderTarget(intptr_t ,
391 [[nodiscard]]
virtual auto IsZTestEnabled() const ->
bool = 0;
392 [[nodiscard]] virtual auto IsZWriteEnabled() const ->
bool = 0;
393 virtual
void SetZWrite(
bool) = 0;
394 virtual
void SetZTestMode(ZTestMode) = 0;
395 virtual
void SetZBias(
float) = 0;
396 virtual
void ClearZBuffer() = 0;
398 virtual
void SetCullMode(CullMode mode) = 0;
400 virtual
void SetAlphaTest(
bool b) = 0;
402 virtual
void SetMaterial(const
RageColor& emissive,
406 float shininess) = 0;
408 virtual
void SetLighting(
bool b) = 0;
409 virtual
void SetLightOff(
int index) = 0;
410 virtual
void SetLightDirectional(
int index,
416 virtual
void SetSphereEnvironmentMapping(TextureUnit tu,
bool b) = 0;
417 virtual
void SetCelShaded(
int stage) = 0;
429 const std::vector<
msMesh>& vMeshes);
442 virtual void SetPolygonMode(PolygonMode ) {}
443 virtual void SetLineWidth(
float ) {}
445 enum GraphicsFileFormat
448 SAVE_LOSSLESS_SENSIBLE,
452 auto SaveScreenshot(
const std::string& sPath, GraphicsFileFormat format)
455 [[nodiscard]]
virtual auto GetTextureDiagnostics(
unsigned )
const
458 return std::string();
460 virtual auto CreateScreenshot()
472 virtual void DrawFanInternal(
const RageSpriteVertex v[],
int iNumVerts) = 0;
486 virtual auto IsD3DInternal() -> bool;
491 virtual auto TryVideoMode(
const VideoModeParams& p,
bool& bNewDeviceOut)
502 void SetDefaultRenderStates();
506 [[nodiscard]]
auto IsPredictiveFrameLimit() const ->
bool;
507 [[nodiscard]] auto GetFPS() const ->
int;
508 [[nodiscard]] auto GetVPF() const ->
int;
509 [[nodiscard]] auto GetCumFPS() const ->
int;
510 virtual
void ResetStats();
511 virtual
void ProcessStatsOnFlip();
512 [[nodiscard]] virtual auto GetStats() const -> std::
string;
513 void StatsAddVerts(
int iNumVertsRendered);
518 void Translate(
float x,
float y,
float z);
519 void TranslateWorld(
float x,
float y,
float z);
520 void Scale(
float x,
float y,
float z);
521 void RotateX(
float deg);
522 void RotateY(
float deg);
523 void RotateZ(
float deg);
524 void SkewX(
float fAmount);
525 void SkewY(
float fAmount);
528 this->PostMultMatrix(f);
535 void TexturePushMatrix();
536 void TexturePopMatrix();
537 void TextureTranslate(
float x,
float y);
540 this->TextureTranslate(v.x, v.y);
544 void CameraPushMatrix();
545 void CameraPopMatrix();
546 void LoadMenuPerspective(
float fFOVDegrees,
550 float fVanishPointY);
551 void LoadLookAt(
float fov,
557 void CenteringPushMatrix();
558 void CenteringPopMatrix();
559 void ChangeCentering(
int trans_x,
564 auto CreateSurfaceFromPixfmt(RagePixelFormat pixfmt,
569 auto FindPixelFormat(
int bpp,
574 bool realtime =
false) -> RagePixelFormat;
577 void PushSelf(lua_State* L);
580 auto GetPerspectiveMatrix(
float fovy,
float aspect,
float zNear,
float zFar)
584 virtual auto GetOrthoMatrix(
float l,
590 virtual auto GetFrustumMatrix(
float l,
598 auto GetCenteringMatrix(
float fTranslateX,
602 void UpdateCentering();
605 [[nodiscard]]
auto GetCentering() const -> const
RageMatrix*;
606 [[nodiscard]] auto GetProjectionTop() const -> const
RageMatrix*;
607 [[nodiscard]] auto GetViewTop() const -> const
RageMatrix*;
608 [[nodiscard]] auto GetWorldTop() const -> const
RageMatrix*;
609 [[nodiscard]] auto GetTextureTop() const -> const
RageMatrix*;
611 void FrameLimitBeforeVsync();
612 void FrameLimitAfterVsync(
int iFPS);
Definition RageTexture.h:14
Definition RageDisplay.h:256