@@ -5609,7 +5609,7 @@ void OGLClientSharedData::FetchCustomDisplayByID_OGL(const NDSDisplayInfo *displ
56095609
56105610#pragma mark -
56115611
5612- OGLVideoOutput::OGLVideoOutput ()
5612+ OGLDisplayPresenter::OGLDisplayPresenter ()
56135613{
56145614 _contextInfo = NULL ;
56155615 _viewportWidth = GPU_FRAMEBUFFER_NATIVE_WIDTH;
@@ -5630,7 +5630,7 @@ OGLVideoOutput::OGLVideoOutput()
56305630 _layerList->reserve (8 );
56315631}
56325632
5633- OGLVideoOutput ::~OGLVideoOutput ()
5633+ OGLDisplayPresenter ::~OGLDisplayPresenter ()
56345634{
56355635 if (this ->_layerList != NULL )
56365636 {
@@ -5647,17 +5647,17 @@ OGLVideoOutput::~OGLVideoOutput()
56475647 glDeleteTextures (2 , this ->_texCPUFilterDstID );
56485648}
56495649
5650- void OGLVideoOutput ::_UpdateNormalSize ()
5650+ void OGLDisplayPresenter ::_UpdateNormalSize ()
56515651{
56525652 this ->GetDisplayLayer ()->SetNeedsUpdateVertices ();
56535653}
56545654
5655- void OGLVideoOutput ::_UpdateOrder ()
5655+ void OGLDisplayPresenter ::_UpdateOrder ()
56565656{
56575657 this ->GetDisplayLayer ()->SetNeedsUpdateVertices ();
56585658}
56595659
5660- void OGLVideoOutput ::_UpdateRotation ()
5660+ void OGLDisplayPresenter ::_UpdateRotation ()
56615661{
56625662 for (size_t i = 0 ; i < _layerList->size (); i++)
56635663 {
@@ -5666,7 +5666,7 @@ void OGLVideoOutput::_UpdateRotation()
56665666 }
56675667}
56685668
5669- void OGLVideoOutput ::_UpdateClientSize ()
5669+ void OGLDisplayPresenter ::_UpdateClientSize ()
56705670{
56715671 this ->_viewportWidth = (GLsizei)(this ->_propsApplied .clientWidth + 0.0001 );
56725672 this ->_viewportHeight = (GLsizei)(this ->_propsApplied .clientHeight + 0.0001 );
@@ -5676,7 +5676,7 @@ void OGLVideoOutput::_UpdateClientSize()
56765676 this ->ClientDisplay3DPresenter ::_UpdateClientSize ();
56775677}
56785678
5679- void OGLVideoOutput ::_UpdateViewScale ()
5679+ void OGLDisplayPresenter ::_UpdateViewScale ()
56805680{
56815681 this ->ClientDisplay3DPresenter ::_UpdateViewScale ();
56825682
@@ -5687,7 +5687,7 @@ void OGLVideoOutput::_UpdateViewScale()
56875687 }
56885688}
56895689
5690- void OGLVideoOutput ::_UpdateViewport ()
5690+ void OGLDisplayPresenter ::_UpdateViewport ()
56915691{
56925692 glViewport (0 , 0 , this ->_viewportWidth , this ->_viewportHeight );
56935693
@@ -5698,17 +5698,17 @@ void OGLVideoOutput::_UpdateViewport()
56985698 }
56995699}
57005700
5701- void OGLVideoOutput ::_LoadNativeDisplayByID (const NDSDisplayID displayID)
5701+ void OGLDisplayPresenter ::_LoadNativeDisplayByID (const NDSDisplayID displayID)
57025702{
57035703 this ->GetDisplayLayer ()->LoadNativeDisplayByID_OGL (displayID);
57045704}
57055705
5706- void OGLVideoOutput ::_LoadCustomDisplayByID (const NDSDisplayID displayID)
5706+ void OGLDisplayPresenter ::_LoadCustomDisplayByID (const NDSDisplayID displayID)
57075707{
57085708 this ->GetDisplayLayer ()->LoadCustomDisplayByID_OGL (displayID);
57095709}
57105710
5711- void OGLVideoOutput ::_ResizeCPUPixelScaler (const VideoFilterTypeID filterID)
5711+ void OGLDisplayPresenter ::_ResizeCPUPixelScaler (const VideoFilterTypeID filterID)
57125712{
57135713 const VideoFilterAttributes newFilterAttr = VideoFilter::GetAttributesByID (filterID);
57145714
@@ -5731,12 +5731,12 @@ void OGLVideoOutput::_ResizeCPUPixelScaler(const VideoFilterTypeID filterID)
57315731 glFinish ();
57325732}
57335733
5734- OGLContextInfo* OGLVideoOutput ::GetContextInfo ()
5734+ OGLContextInfo* OGLDisplayPresenter ::GetContextInfo ()
57355735{
57365736 return this ->_contextInfo ;
57375737}
57385738
5739- void OGLVideoOutput ::Init ()
5739+ void OGLDisplayPresenter ::Init ()
57405740{
57415741 this ->_canFilterOnGPU = ( this ->_contextInfo ->IsShaderSupported () && this ->_contextInfo ->IsFBOSupported () );
57425742 this ->_filtersPreferGPU = true ;
@@ -5790,64 +5790,64 @@ void OGLVideoOutput::Init()
57905790 }
57915791}
57925792
5793- void OGLVideoOutput ::SetOutputFilter (const OutputFilterTypeID filterID)
5793+ void OGLDisplayPresenter ::SetOutputFilter (const OutputFilterTypeID filterID)
57945794{
57955795 this ->_outputFilter = this ->GetDisplayLayer ()->SetOutputFilterOGL (filterID);
57965796 this ->GetDisplayLayer ()->SetNeedsUpdateRotationScale ();
57975797 this ->_needUpdateViewport = true ;
57985798}
57995799
5800- void OGLVideoOutput ::SetPixelScaler (const VideoFilterTypeID filterID)
5800+ void OGLDisplayPresenter ::SetPixelScaler (const VideoFilterTypeID filterID)
58015801{
58025802 this ->ClientDisplay3DPresenter ::SetPixelScaler (filterID);
58035803
58045804 this ->_hasOGLPixelScaler = this ->GetDisplayLayer ()->SetGPUPixelScalerOGL (this ->_pixelScaler );
58055805 this ->_willFilterOnGPU = (this ->GetFiltersPreferGPU ()) ? this ->_hasOGLPixelScaler : false ;
58065806}
58075807
5808- void OGLVideoOutput ::CopyHUDFont (const FT_Face &fontFace, const size_t glyphSize, const size_t glyphTileSize, GlyphInfo *glyphInfo)
5808+ void OGLDisplayPresenter ::CopyHUDFont (const FT_Face &fontFace, const size_t glyphSize, const size_t glyphTileSize, GlyphInfo *glyphInfo)
58095809{
58105810 this ->GetHUDLayer ()->CopyHUDFont (fontFace, glyphSize, glyphTileSize, glyphInfo);
58115811}
58125812
5813- void OGLVideoOutput ::SetHUDVisibility (const bool visibleState)
5813+ void OGLDisplayPresenter ::SetHUDVisibility (const bool visibleState)
58145814{
58155815 this ->GetHUDLayer ()->SetVisibility (visibleState);
58165816 this ->ClientDisplay3DPresenter ::SetHUDVisibility (visibleState);
58175817}
58185818
5819- void OGLVideoOutput ::SetFiltersPreferGPU (const bool preferGPU)
5819+ void OGLDisplayPresenter ::SetFiltersPreferGPU (const bool preferGPU)
58205820{
58215821 this ->_filtersPreferGPU = preferGPU;
58225822 this ->_willFilterOnGPU = (preferGPU) ? this ->_hasOGLPixelScaler : false ;
58235823}
58245824
5825- GLuint OGLVideoOutput ::GetTexCPUFilterDstID (const NDSDisplayID displayID) const
5825+ GLuint OGLDisplayPresenter ::GetTexCPUFilterDstID (const NDSDisplayID displayID) const
58265826{
58275827 return this ->_texCPUFilterDstID [displayID];
58285828}
58295829
5830- GLsizei OGLVideoOutput ::GetViewportWidth ()
5830+ GLsizei OGLDisplayPresenter ::GetViewportWidth ()
58315831{
58325832 return this ->_viewportWidth ;
58335833}
58345834
5835- GLsizei OGLVideoOutput ::GetViewportHeight ()
5835+ GLsizei OGLDisplayPresenter ::GetViewportHeight ()
58365836{
58375837 return this ->_viewportHeight ;
58385838}
58395839
5840- OGLDisplayLayer* OGLVideoOutput ::GetDisplayLayer ()
5840+ OGLDisplayLayer* OGLDisplayPresenter ::GetDisplayLayer ()
58415841{
58425842 return (OGLDisplayLayer *)this ->_layerList ->at (0 );
58435843}
58445844
5845- OGLHUDLayer* OGLVideoOutput ::GetHUDLayer ()
5845+ OGLHUDLayer* OGLDisplayPresenter ::GetHUDLayer ()
58465846{
58475847 return (OGLHUDLayer *)this ->_layerList ->at (1 );
58485848}
58495849
5850- void OGLVideoOutput ::ProcessDisplays ()
5850+ void OGLDisplayPresenter ::ProcessDisplays ()
58515851{
58525852 OGLDisplayLayer *displayLayer = this ->GetDisplayLayer ();
58535853 if (displayLayer->IsVisible ())
@@ -5856,7 +5856,7 @@ void OGLVideoOutput::ProcessDisplays()
58565856 }
58575857}
58585858
5859- void OGLVideoOutput ::CopyFrameToBuffer (uint32_t *dstBuffer)
5859+ void OGLDisplayPresenter ::CopyFrameToBuffer (uint32_t *dstBuffer)
58605860{
58615861 if (!this ->_contextInfo ->IsFBOSupported ())
58625862 {
@@ -5892,7 +5892,7 @@ void OGLVideoOutput::CopyFrameToBuffer(uint32_t *dstBuffer)
58925892 this ->_needUpdateViewport = true ;
58935893}
58945894
5895- void OGLVideoOutput ::PrerenderStateSetupOGL ()
5895+ void OGLDisplayPresenter ::PrerenderStateSetupOGL ()
58965896{
58975897 // If the context is managed by us, then setting all of OpenGL's states
58985898 // once at initialization time should be enough.
@@ -5928,7 +5928,7 @@ void OGLVideoOutput::PrerenderStateSetupOGL()
59285928 }
59295929}
59305930
5931- void OGLVideoOutput ::RenderFrameOGL (bool isRenderingFlipped)
5931+ void OGLDisplayPresenter ::RenderFrameOGL (bool isRenderingFlipped)
59325932{
59335933 if (this ->_needUpdateViewport )
59345934 {
@@ -5949,31 +5949,16 @@ void OGLVideoOutput::RenderFrameOGL(bool isRenderingFlipped)
59495949 }
59505950}
59515951
5952- const OGLFrameInfoProcessed& OGLVideoOutput ::GetFrameInfoProcessed ()
5952+ const OGLFrameInfoProcessed& OGLDisplayPresenter ::GetFrameInfoProcessed ()
59535953{
59545954 return this ->_processedFrameInfo ;
59555955}
59565956
5957- void OGLVideoOutput ::SetFrameInfoProcessed (const OGLFrameInfoProcessed &processedInfo)
5957+ void OGLDisplayPresenter ::SetFrameInfoProcessed (const OGLFrameInfoProcessed &processedInfo)
59585958{
59595959 this ->_processedFrameInfo = processedInfo;
59605960}
59615961
5962- void OGLVideoOutput::WriteLockEmuFramebuffer (const uint8_t bufferIndex)
5963- {
5964- // Do nothing. This is implementation dependent.
5965- }
5966-
5967- void OGLVideoOutput::ReadLockEmuFramebuffer (const uint8_t bufferIndex)
5968- {
5969- // Do nothing. This is implementation dependent.
5970- }
5971-
5972- void OGLVideoOutput::UnlockEmuFramebuffer (const uint8_t bufferIndex)
5973- {
5974- // Do nothing. This is implementation dependent.
5975- }
5976-
59775962#pragma mark -
59785963
59795964OGLFilter::OGLFilter ()
@@ -6997,7 +6982,7 @@ void OGLVideoLayer::SetVisibility(const bool visibleState)
69976982
69986983#pragma mark -
69996984
7000- OGLHUDLayer::OGLHUDLayer (OGLVideoOutput *oglVO)
6985+ OGLHUDLayer::OGLHUDLayer (OGLDisplayPresenter *oglVO)
70016986{
70026987 _isVisible = false ;
70036988 _needUpdateViewport = true ;
@@ -7149,7 +7134,7 @@ void OGLHUDLayer::CopyHUDFont(const FT_Face &fontFace, const size_t glyphSize, c
71497134 error = FT_Set_Char_Size (fontFace, gSize << 6 , gSize << 6 , 72 , 72 );
71507135 if (error)
71517136 {
7152- printf (" OGLVideoOutput : FreeType failed to set the font size!\n " );
7137+ printf (" OGLDisplayPresenter : FreeType failed to set the font size!\n " );
71537138 }
71547139
71557140 const FT_GlyphSlot glyphSlot = fontFace->glyph ;
@@ -7241,6 +7226,7 @@ void OGLHUDLayer::_UpdateVerticesOGL()
72417226
72427227void OGLHUDLayer::RenderOGL (bool isRenderingFlipped)
72437228{
7229+ const bool isShaderSupported = this ->_output ->GetContextInfo ()->IsShaderSupported ();
72447230 size_t hudLength = this ->_output ->GetHUDString ().length ();
72457231 size_t hudTouchLineLength = 0 ;
72467232
@@ -7285,7 +7271,7 @@ void OGLHUDLayer::RenderOGL(bool isRenderingFlipped)
72857271
72867272 glEnable (GL_BLEND);
72877273
7288- if (this -> _output -> GetContextInfo ()-> IsShaderSupported () )
7274+ if (isShaderSupported )
72897275 {
72907276 glUseProgram (this ->_program ->GetProgramID ());
72917277
@@ -7331,7 +7317,7 @@ void OGLHUDLayer::RenderOGL(bool isRenderingFlipped)
73317317 const ClientDisplayPresenterProperties &cdp = this ->_output ->GetPresenterProperties ();
73327318
73337319 // Draw the touch lines first.
7334- if (this -> _output -> GetContextInfo ()-> IsShaderSupported () )
7320+ if (isShaderSupported )
73357321 {
73367322 glUniform1f (this ->_uniformAngleDegrees , cdp.rotation );
73377323 glUniform1f (this ->_uniformScalar , cdp.viewScale );
@@ -7349,7 +7335,7 @@ void OGLHUDLayer::RenderOGL(bool isRenderingFlipped)
73497335 glDrawElements (GL_TRIANGLES, (GLsizei)(hudTouchLineLength * 6 ), GL_UNSIGNED_SHORT, (GLvoid *)((this ->_output ->GetHUDString ().length () + HUD_INPUT_ELEMENT_LENGTH) * 6 * sizeof (uint16_t )));
73507336
73517337 // Then draw the input buttons overlay.
7352- if (this -> _output -> GetContextInfo ()-> IsShaderSupported () )
7338+ if (isShaderSupported )
73537339 {
73547340 glUniform1f (this ->_uniformAngleDegrees , 0 .0f );
73557341 glUniform1f (this ->_uniformScalar , 1 .0f );
@@ -7368,7 +7354,7 @@ void OGLHUDLayer::RenderOGL(bool isRenderingFlipped)
73687354 }
73697355
73707356 // Next, draw the backing text box.
7371- if (this -> _output -> GetContextInfo ()-> IsShaderSupported () )
7357+ if (isShaderSupported )
73727358 {
73737359 glUniform1f (this ->_uniformAngleDegrees , 0 .0f );
73747360 glUniform1f (this ->_uniformScalar , 1 .0f );
@@ -7407,7 +7393,7 @@ void OGLHUDLayer::RenderOGL(bool isRenderingFlipped)
74077393
74087394#pragma mark -
74097395
7410- OGLDisplayLayer::OGLDisplayLayer (OGLVideoOutput *oglVO)
7396+ OGLDisplayLayer::OGLDisplayLayer (OGLDisplayPresenter *oglVO)
74117397{
74127398 _isVisible = true ;
74137399 _output = oglVO;
0 commit comments