39 void Set(
const std::vector<msMesh>& vMeshes,
bool bNeedsNormals);
41 virtual void Allocate(
const std::vector<msMesh>& vMeshes) = 0;
42 virtual void Change(
const std::vector<msMesh>& vMeshes) = 0;
46 virtual void Draw(
int iMeshIndex)
const = 0;
49 [[nodiscard]]
auto GetTotalVertices()
const ->
size_t
51 if (m_vMeshInfo.empty()) {
54 return m_vMeshInfo.back().iVertexStart +
55 m_vMeshInfo.back().iVertexCount;
57 [[nodiscard]]
auto GetTotalTriangles()
const ->
size_t
59 if (m_vMeshInfo.empty()) {
62 return m_vMeshInfo.back().iTriangleStart +
63 m_vMeshInfo.back().iTriangleCount;
72 bool m_bNeedsTextureMatrixScale;
74 std::vector<MeshInfo> m_vMeshInfo;
75 bool m_bNeedsNormals{};
76 bool m_bAnyNeedsTextureMatrixScale{};
107 std::string sDisplayId_,
115 bool bTrilinearFiltering_,
116 bool bAnisotropicFiltering_,
117 bool bWindowIsFullscreenBorderless_,
118 std::string sWindowTitle_,
119 std::string sIconFile_,
121 float fDisplayAspectRatio_)
122 : windowed(windowed_)
123 , sDisplayId(std::move(sDisplayId_))
129 , interlaced(interlaced_)
130 , bSmoothLines(bSmoothLines_)
131 , bTrilinearFiltering(bTrilinearFiltering_)
132 , bAnisotropicFiltering(bAnisotropicFiltering_)
133 , bWindowIsFullscreenBorderless(bWindowIsFullscreenBorderless_)
134 , sWindowTitle(std::move(sWindowTitle_))
135 , sIconFile(std::move(sIconFile_))
137 , fDisplayAspectRatio(fDisplayAspectRatio_)
142 : windowed(other.windowed)
143 , sDisplayId(other.sDisplayId)
145 , height(other.height)
149 , interlaced(other.interlaced)
150 , bSmoothLines(other.bSmoothLines)
151 , bTrilinearFiltering(other.bTrilinearFiltering)
152 , bAnisotropicFiltering(other.bAnisotropicFiltering)
153 , bWindowIsFullscreenBorderless(other.bWindowIsFullscreenBorderless)
154 , sWindowTitle(other.sWindowTitle)
155 , sIconFile(other.sIconFile)
157 , fDisplayAspectRatio(other.fDisplayAspectRatio)
162 : windowed(other.windowed)
163 , sDisplayId(std::move(other.sDisplayId))
165 , height(other.height)
169 , interlaced(other.interlaced)
170 , bSmoothLines(other.bSmoothLines)
171 , bTrilinearFiltering(other.bTrilinearFiltering)
172 , bAnisotropicFiltering(other.bAnisotropicFiltering)
173 , bWindowIsFullscreenBorderless(other.bWindowIsFullscreenBorderless)
174 , sWindowTitle(std::move(other.sWindowTitle))
175 , sIconFile(std::move(other.sIconFile))
177 , fDisplayAspectRatio(other.fDisplayAspectRatio)
184 bool windowed{
false };
185 std::string sDisplayId;
191 bool interlaced{
false };
192 bool bSmoothLines{
false };
193 bool bTrilinearFiltering{
false };
194 bool bAnisotropicFiltering{
false };
195 bool bWindowIsFullscreenBorderless{
false };
196 std::string sWindowTitle;
197 std::string sIconFile;
199 float fDisplayAspectRatio{ 0.0F };
280 unsigned int masks[4];
283 [[nodiscard]]
virtual auto GetPixelFormatDesc(RagePixelFormat pf)
const
290 bool bAllowUnacceleratedRenderer) -> std::string = 0;
292 [[nodiscard]]
virtual auto GetApiDescription() const -> std::
string = 0;
293 virtual
void GetDisplaySpecs(DisplaySpecs& out) const = 0;
295 void SetPresentTime(std::chrono::nanoseconds presentTime);
304 virtual
void ResolutionChanged();
305 auto IsD3D() ->
bool;
307 virtual auto BeginFrame() ->
bool;
308 virtual
void EndFrame();
309 [[nodiscard]] virtual auto GetActualVideoModeParams() const
311 auto IsWindowed() ->
bool {
return (*GetActualVideoModeParams()).windowed; }
313 auto GetFrameTimingAdjustment(std::chrono::steady_clock::time_point now)
316 virtual void SetBlendMode(BlendMode mode) = 0;
318 virtual auto SupportsTextureFormat(RagePixelFormat pixfmt,
319 bool realtime =
false) ->
bool = 0;
320 virtual auto SupportsThreadedRendering() ->
bool {
return false; }
321 virtual auto SupportsPerVertexMatrixScale() ->
bool = 0;
325 virtual void BeginConcurrentRenderingMainThread() {}
326 virtual void EndConcurrentRenderingMainThread() {}
327 virtual void BeginConcurrentRendering();
328 virtual void EndConcurrentRendering() {}
332 virtual auto CreateTexture(
333 RagePixelFormat pixfmt,
335 bool bGenerateMipMaps) -> intptr_t = 0;
336 virtual void UpdateTexture(intptr_t iTexHandle,
342 virtual void DeleteTexture(intptr_t iTexHandle) = 0;
345 virtual auto CreateTextureLock() ->
RageTextureLock* {
return nullptr; }
346 virtual void ClearAllTextures() = 0;
347 virtual auto GetNumTextureUnits() ->
int = 0;
348 virtual void SetTexture(TextureUnit, intptr_t ) = 0;
349 virtual void SetTextureMode(TextureUnit, TextureMode) = 0;
350 virtual void SetTextureWrapping(TextureUnit,
bool) = 0;
351 [[nodiscard]]
virtual auto GetMaxTextureSize() const ->
int = 0;
352 virtual
void SetTextureFiltering(TextureUnit,
bool) = 0;
353 virtual
void SetEffectMode(EffectMode ) {}
354 virtual auto IsEffectModeSupported(EffectMode effect) ->
bool
356 return effect == EffectMode_Normal;
359 [[nodiscard]]
virtual auto SupportsRenderToTexture() const ->
bool
363 [[nodiscard]]
virtual auto SupportsFullscreenBorderlessWindow() const
382 virtual auto GetRenderTarget() -> intptr_t {
return 0; }
390 virtual void SetRenderTarget(intptr_t ,
395 [[nodiscard]]
virtual auto IsZTestEnabled() const ->
bool = 0;
396 [[nodiscard]] virtual auto IsZWriteEnabled() const ->
bool = 0;
397 virtual
void SetZWrite(
bool) = 0;
398 virtual
void SetZTestMode(ZTestMode) = 0;
399 virtual
void SetZBias(
float) = 0;
400 virtual
void ClearZBuffer() = 0;
402 virtual
void SetCullMode(CullMode mode) = 0;
404 virtual
void SetAlphaTest(
bool b) = 0;
406 virtual
void SetMaterial(const
RageColor& emissive,
410 float shininess) = 0;
412 virtual
void SetLighting(
bool b) = 0;
413 virtual
void SetLightOff(
int index) = 0;
414 virtual
void SetLightDirectional(
int index,
420 virtual
void SetSphereEnvironmentMapping(TextureUnit tu,
bool b) = 0;
421 virtual
void SetCelShaded(
int stage) = 0;
423 virtual DisplayAdapter::PipelineHandle CreateGraphicsPipeline(
424 const std::
string& vertexShaderPath,
425 const std::
string& fragmentShaderPath) {
428 virtual void ReloadPipelines() {}
429 virtual void SetGraphicsPipeline(
431 const std::vector<uint8_t>& vertexShaderArgs,
432 const std::vector<uint8_t>& fragShaderArgs,
445 const std::vector<msMesh>& vMeshes);
458 virtual void SetPolygonMode(PolygonMode ) {}
459 virtual void SetLineWidth(
float ) {}
461 enum GraphicsFileFormat
464 SAVE_LOSSLESS_SENSIBLE,
468 auto SaveScreenshot(
const std::string& sPath, GraphicsFileFormat format)
471 [[nodiscard]]
virtual auto GetTextureDiagnostics(
unsigned )
const
474 return std::string();
476 virtual auto CreateScreenshot()
483 bool DisplayDebugModeEnabled();
490 virtual void DrawFanInternal(
const RageSpriteVertex v[],
int iNumVerts) = 0;
504 virtual auto IsD3DInternal() -> bool;
509 virtual auto TryVideoMode(
const VideoModeParams& p,
bool& bNewDeviceOut)
520 void SetDefaultRenderStates();
524 [[nodiscard]]
auto IsPredictiveFrameLimit() const ->
bool;
525 [[nodiscard]] auto GetFPS() const ->
int;
526 [[nodiscard]] auto GetVPF() const ->
int;
527 [[nodiscard]] auto GetCumFPS() const ->
int;
528 virtual
void ResetStats();
529 virtual
void ProcessStatsOnFlip();
530 [[nodiscard]] virtual auto GetStats() const -> std::
string;
531 void StatsAddVerts(
int iNumVertsRendered);
536 void Translate(
float x,
float y,
float z);
537 void TranslateWorld(
float x,
float y,
float z);
538 void Scale(
float x,
float y,
float z);
539 void RotateX(
float deg);
540 void RotateY(
float deg);
541 void RotateZ(
float deg);
542 void SkewX(
float fAmount);
543 void SkewY(
float fAmount);
546 this->PostMultMatrix(f);
553 void TexturePushMatrix();
554 void TexturePopMatrix();
555 void TextureTranslate(
float x,
float y);
558 this->TextureTranslate(v.x, v.y);
562 void CameraPushMatrix();
563 void CameraPopMatrix();
564 void LoadMenuPerspective(
float fFOVDegrees,
568 float fVanishPointY);
569 void LoadLookAt(
float fov,
575 void CenteringPushMatrix();
576 void CenteringPopMatrix();
577 void ChangeCentering(
int trans_x,
582 auto CreateSurfaceFromPixfmt(RagePixelFormat pixfmt,
587 auto FindPixelFormat(
int bpp,
592 bool realtime =
false) -> RagePixelFormat;
595 void PushSelf(lua_State* L);
598 auto GetPerspectiveMatrix(
float fovy,
float aspect,
float zNear,
float zFar)
602 virtual auto GetOrthoMatrix(
float l,
608 virtual auto GetFrustumMatrix(
float l,
616 auto GetCenteringMatrix(
float fTranslateX,
620 void UpdateCentering();
623 [[nodiscard]]
auto GetCentering() const -> const
RageMatrix*;
624 [[nodiscard]] auto GetProjectionTop() const -> const
RageMatrix*;
625 [[nodiscard]] auto GetViewTop() const -> const
RageMatrix*;
626 [[nodiscard]] auto GetWorldTop() const -> const
RageMatrix*;
627 [[nodiscard]] auto GetTextureTop() const -> const
RageMatrix*;
629 void FrameLimitBeforeVsync();
630 void FrameLimitAfterVsync(
int iFPS);
Definition RageTexture.h:14
Definition RageDisplay.h:257