2929#include  "../../retroarch.h" 
3030#include  "../../verbosity.h" 
3131
32- #ifdef  HAVE_EGL 
3332#include  "../common/egl_common.h" 
34- #endif 
3533
3634typedef  struct 
3735{
38- #ifdef  HAVE_EGL 
3936   egl_ctx_data_t  egl ;
40- #endif 
4137   int  initial_width ;
4238   int  initial_height ;
4339   unsigned  fb_width ;
@@ -70,7 +66,7 @@ static void gfx_ctx_emscripten_get_canvas_size(int *width, int *height)
7066
7167   if  (!is_fullscreen )
7268   {
73-       r  =  emscripten_get_canvas_element_size ("! canvas" , width , height );
69+       r  =  emscripten_get_canvas_element_size ("# canvas" , width , height );
7470
7571      if  (r  !=  EMSCRIPTEN_RESULT_SUCCESS )
7672      {
@@ -105,14 +101,14 @@ static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
105101   if  (  (input_width   !=  emscripten -> fb_width )
106102      ||  (input_height  !=  emscripten -> fb_height ))
107103   {
108-       r  =  emscripten_set_canvas_element_size ("! canvas" ,
104+       r  =  emscripten_set_canvas_element_size ("# canvas" ,
109105         input_width , input_height );
110106
111107      if  (r  !=  EMSCRIPTEN_RESULT_SUCCESS )
112108         RARCH_ERR ("[EMSCRIPTEN/EGL]: error resizing canvas: %d\n" , r );
113109
114110      /* fix Module.requestFullscreen messing with the canvas size */ 
115-       r  =  emscripten_set_element_css_size ("! canvas" ,
111+       r  =  emscripten_set_element_css_size ("# canvas" ,
116112         (double )input_width , (double )input_height );
117113
118114      if  (r  !=  EMSCRIPTEN_RESULT_SUCCESS )
@@ -128,12 +124,10 @@ static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
128124
129125static  void  gfx_ctx_emscripten_swap_buffers (void  * data )
130126{
131- #ifdef  HAVE_EGL 
132127   /* Doesn't really do anything in WebGL, but it might  
133128    * if we use WebGL workers in the future */ 
134129   emscripten_ctx_data_t  * emscripten  =  (emscripten_ctx_data_t * )data ;
135130   egl_swap_buffers (& emscripten -> egl );
136- #endif 
137131}
138132
139133static  void  gfx_ctx_emscripten_get_video_size (void  * data ,
@@ -155,16 +149,13 @@ static void gfx_ctx_emscripten_destroy(void *data)
155149   if  (!emscripten )
156150      return ;
157151
158- #ifdef  HAVE_EGL 
159152   egl_destroy (& emscripten -> egl );
160- #endif 
161153
162154   free (data );
163155}
164156
165157static  void  * gfx_ctx_emscripten_init (void  * video_driver )
166158{
167- #ifdef  HAVE_EGL 
168159   unsigned  width , height ;
169160   EGLint  major , minor ;
170161   EGLint  n ;
@@ -183,7 +174,6 @@ static void *gfx_ctx_emscripten_init(void *video_driver)
183174      EGL_CONTEXT_CLIENT_VERSION , 2 ,
184175      EGL_NONE 
185176   };
186- #endif 
187177   emscripten_ctx_data_t  * emscripten  =  (emscripten_ctx_data_t * )
188178      calloc (1 , sizeof (* emscripten ));
189179
@@ -194,11 +184,10 @@ static void *gfx_ctx_emscripten_init(void *video_driver)
194184    * be grabbed? */ 
195185   if  (     (emscripten -> initial_width   ==  0 )
196186         ||  (emscripten -> initial_height  ==  0 ))
197-       emscripten_get_canvas_element_size ("! canvas" ,
187+       emscripten_get_canvas_element_size ("# canvas" ,
198188         & emscripten -> initial_width ,
199189         & emscripten -> initial_height );
200190
201- #ifdef  HAVE_EGL 
202191   if  (g_egl_inited )
203192   {
204193      RARCH_LOG ("[EMSCRIPTEN/EGL]: Attempted to re-initialize driver.\n" );
@@ -226,7 +215,6 @@ static void *gfx_ctx_emscripten_init(void *video_driver)
226215   emscripten -> fb_width   =  width ;
227216   emscripten -> fb_height  =  height ;
228217   RARCH_LOG ("[EMSCRIPTEN/EGL]: Dimensions: %ux%u\n" , width , height );
229- #endif 
230218
231219   return  emscripten ;
232220
@@ -251,10 +239,8 @@ static enum gfx_ctx_api gfx_ctx_emscripten_get_api(void *data) { return GFX_CTX_
251239static  bool  gfx_ctx_emscripten_bind_api (void  * data ,
252240      enum  gfx_ctx_api  api , unsigned  major , unsigned  minor )
253241{
254- #ifdef  HAVE_EGL 
255242   if  (api  ==  GFX_CTX_OPENGL_ES_API )
256243      return  egl_bind_api (EGL_OPENGL_ES_API );
257- #endif 
258244   return  false;
259245}
260246
@@ -283,10 +269,8 @@ static bool gfx_ctx_emscripten_write_egl_image(void *data,
283269
284270static  void  gfx_ctx_emscripten_bind_hw_render (void  * data , bool  enable )
285271{
286- #ifdef  HAVE_EGL 
287272   emscripten_ctx_data_t  * emscripten  =  (emscripten_ctx_data_t * )data ;
288273   egl_bind_hw_render (& emscripten -> egl , enable );
289- #endif 
290274}
291275
292276static  uint32_t  gfx_ctx_emscripten_get_flags (void  * data )
@@ -320,11 +304,7 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = {
320304   false,
321305   gfx_ctx_emscripten_swap_buffers ,
322306   gfx_ctx_emscripten_input_driver ,
323- #ifdef  HAVE_EGL 
324307   egl_get_proc_address ,
325- #else 
326-    NULL ,
327- #endif 
328308   gfx_ctx_emscripten_init_egl_image_buffer ,
329309   gfx_ctx_emscripten_write_egl_image ,
330310   NULL ,
0 commit comments