Skip to content

Commit 620bc26

Browse files
Refactored EAGL_egl_driver's dispatch table function names. Prefixed EAGL iOS driver functions with EAGLIOS_
1 parent 2666d51 commit 620bc26

File tree

3 files changed

+131
-148
lines changed

3 files changed

+131
-148
lines changed

include/EGL/drivers/eagl/egl_eagl_driver.h

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -142,41 +142,41 @@ struct EAGL_egl_driver
142142
void *handle;
143143

144144
/* EAGL x.x */
145-
EAGLINITIALIZEPROC eaglInitialize;
146-
EAGLTERMINATEPROC eaglTerminate;
145+
EAGLINITIALIZEPROC Initialize;
146+
EAGLTERMINATEPROC Terminate;
147147

148-
EAGLGETCONFIGSPROC eaglGetConfigs;
148+
EAGLGETCONFIGSPROC GetConfigs;
149149

150-
EAGLCREATECONTEXTPROC eaglCreateContext;
151-
EAGLDESTROYCONTEXTPROC eaglDestroyContext;
150+
EAGLCREATECONTEXTPROC CreateContext;
151+
EAGLDESTROYCONTEXTPROC DestroyContext;
152152

153-
EAGLMAKECURRENTPROC eaglMakeCurrent;
153+
EAGLMAKECURRENTPROC MakeCurrent;
154154

155-
EAGLGETPROCADDRESSPROC eaglGetProcAddress;
155+
EAGLGETPROCADDRESSPROC GetProcAddress;
156156

157157

158-
EAGLSWAPBUFFERSPROC eaglSwapBuffers;
159-
EAGLSWAPINTERVALPROC eaglSwapInterval;
160-
EAGLQUERYVERSIONPROC eaglQueryVersion;
158+
EAGLSWAPBUFFERSPROC SwapBuffers;
159+
EAGLSWAPINTERVALPROC SwapInterval;
160+
EAGLQUERYVERSIONPROC QueryVersion;
161161

162-
EAGLWAITGLPROC eaglWaitGL;
163-
EAGLWAITNATIVEPROC eaglWaitNative;
162+
EAGLWAITGLPROC WaitGL;
163+
EAGLWAITNATIVEPROC WaitNative;
164164

165-
EAGLQUERYEXTENSIONSSTRINGPROC eaglQueryExtensionsString;
166-
EAGLQUERYSERVERSTRINGPROC eaglQueryServerString;
167-
EAGLGETCLIENTSTRINGPROC eaglGetClientString;
165+
EAGLQUERYEXTENSIONSSTRINGPROC QueryExtensionsString;
166+
EAGLQUERYSERVERSTRINGPROC QueryServerString;
167+
EAGLGETCLIENTSTRINGPROC GetClientString;
168168

169-
EAGLCREATEWINDOWPROC eaglCreateWindow;
170-
EAGLDESTROYWINDOWPROC eaglDestroyWindow;
171-
EAGLCREATEPIXMAPPROC eaglCreatePixmap;
172-
EAGLDESTROYPIXMAPPROC eaglDestroyPixmap;
173-
EAGLCREATEPBUFFERPROC eaglCreatePbuffer;
174-
EAGLDESTROYPBUFFERPROC eaglDestroyPbuffer;
169+
EAGLCREATEWINDOWPROC CreateWindow;
170+
EAGLDESTROYWINDOWPROC DestroyWindow;
171+
EAGLCREATEPIXMAPPROC CreatePixmap;
172+
EAGLDESTROYPIXMAPPROC DestroyPixmap;
173+
EAGLCREATEPBUFFERPROC CreatePbuffer;
174+
EAGLDESTROYPBUFFERPROC DestroyPbuffer;
175175

176-
EAGLQUERYYSURFACEPROC eaglQuerySurface;
176+
EAGLQUERYYSURFACEPROC QuerySurface;
177177

178-
EAGLCREATENEWCONTEXTPROC eaglCreateNewContext;
179-
EAGLMAKECONTEXTCURRENTPROC eaglMakeContextCurrent;
178+
EAGLCREATENEWCONTEXTPROC CreateNewContext;
179+
EAGLMAKECONTEXTCURRENTPROC MakeContextCurrent;
180180
};
181181

182182
static void
@@ -196,45 +196,42 @@ EAGL_Load(_EGLDriver *drv)
196196
struct EAGL_egl_driver *EAGL_drv = EAGL_egl_driver(drv);
197197
void *handle = NULL;
198198

199-
if (!EAGL_drv->eaglGetProcAddress)
199+
if (!EAGL_drv->GetProcAddress)
200200
goto fail;
201201

202202
#define GET_PROC(proc_type, proc_name, check) \
203203
do { \
204204
EAGL_drv->proc_name = (proc_type) \
205-
EAGL_drv->eaglGetProcAddress( #proc_name ); \
205+
EAGL_drv->GetProcAddress( #proc_name ); \
206206
if (check && !EAGL_drv->proc_name) goto fail; \
207207
} while (0)
208208

209209
/* EAGL x.x */
210-
GET_PROC(EAGLINITIALIZEPROC, eaglInitialize, EGL_TRUE);
211-
GET_PROC(EAGLTERMINATEPROC, eaglTerminate, EGL_TRUE);
212-
GET_PROC(EAGLCREATECONTEXTPROC, eaglCreateContext, EGL_TRUE);
213-
GET_PROC(EAGLDESTROYCONTEXTPROC, eaglDestroyContext, EGL_TRUE);
214-
GET_PROC(EAGLMAKECURRENTPROC, eaglMakeCurrent, EGL_TRUE);
215-
GET_PROC(EAGLSWAPBUFFERSPROC, eaglSwapBuffers, EGL_TRUE);
216-
GET_PROC(EAGLSWAPINTERVALPROC, eaglSwapInterval, EGL_TRUE);
217-
GET_PROC(EAGLQUERYVERSIONPROC, eaglQueryVersion, EGL_TRUE);
218-
GET_PROC(EAGLWAITGLPROC, eaglWaitGL, EGL_TRUE);
219-
GET_PROC(EAGLWAITNATIVEPROC, eaglWaitNative, EGL_TRUE);
220-
221-
GET_PROC(EAGLQUERYEXTENSIONSSTRINGPROC, eaglQueryExtensionsString, EGL_TRUE);
222-
GET_PROC(EAGLQUERYSERVERSTRINGPROC, eaglQueryServerString, EGL_TRUE);
223-
GET_PROC(EAGLGETCLIENTSTRINGPROC, eaglGetClientString, EGL_TRUE);
224-
225-
GET_PROC(EAGLGETCONFIGSPROC, eaglGetConfigs, EGL_FALSE);
226-
GET_PROC(EAGLCREATEWINDOWPROC, eaglCreateWindow, EGL_TRUE);
227-
GET_PROC(EAGLDESTROYWINDOWPROC, eaglDestroyWindow, EGL_TRUE);
228-
GET_PROC(EAGLCREATEPIXMAPPROC, eaglCreatePixmap, EGL_TRUE);
229-
GET_PROC(EAGLDESTROYPIXMAPPROC, eaglDestroyPixmap, EGL_TRUE);
230-
GET_PROC(EAGLCREATEPBUFFERPROC, eaglCreatePbuffer, EGL_TRUE);
231-
GET_PROC(EAGLDESTROYPBUFFERPROC, eaglDestroyPbuffer, EGL_TRUE);
210+
GET_PROC(EAGLINITIALIZEPROC, Initialize, EGL_TRUE);
211+
GET_PROC(EAGLTERMINATEPROC, Terminate, EGL_TRUE);
212+
GET_PROC(EAGLCREATECONTEXTPROC, CreateContext, EGL_TRUE);
213+
GET_PROC(EAGLDESTROYCONTEXTPROC, DestroyContext, EGL_TRUE);
214+
GET_PROC(EAGLMAKECURRENTPROC, MakeCurrent, EGL_TRUE);
215+
GET_PROC(EAGLSWAPBUFFERSPROC, SwapBuffers, EGL_TRUE);
216+
GET_PROC(EAGLSWAPINTERVALPROC, SwapInterval, EGL_TRUE);
217+
GET_PROC(EAGLQUERYVERSIONPROC, QueryVersion, EGL_TRUE);
218+
GET_PROC(EAGLWAITGLPROC, WaitGL, EGL_TRUE);
219+
GET_PROC(EAGLWAITNATIVEPROC, WaitNative, EGL_TRUE);
220+
221+
GET_PROC(EAGLQUERYEXTENSIONSSTRINGPROC, QueryExtensionsString, EGL_TRUE);
222+
GET_PROC(EAGLQUERYSERVERSTRINGPROC, QueryServerString, EGL_TRUE);
223+
GET_PROC(EAGLGETCLIENTSTRINGPROC, GetClientString, EGL_TRUE);
224+
225+
GET_PROC(EAGLGETCONFIGSPROC, GetConfigs, EGL_FALSE);
226+
GET_PROC(EAGLCREATEWINDOWPROC, CreateWindow, EGL_TRUE);
227+
GET_PROC(EAGLDESTROYWINDOWPROC, DestroyWindow, EGL_TRUE);
228+
GET_PROC(EAGLCREATEPIXMAPPROC, CreatePixmap, EGL_TRUE);
229+
GET_PROC(EAGLDESTROYPIXMAPPROC, DestroyPixmap, EGL_TRUE);
230+
GET_PROC(EAGLCREATEPBUFFERPROC, CreatePbuffer, EGL_TRUE);
231+
GET_PROC(EAGLDESTROYPBUFFERPROC, DestroyPbuffer, EGL_TRUE);
232232

233-
GET_PROC(EAGLQUERYYSURFACEPROC, eaglQuerySurface, EGL_TRUE);
233+
GET_PROC(EAGLQUERYYSURFACEPROC, QuerySurface, EGL_TRUE);
234234

235-
GET_PROC(EAGLCREATENEWCONTEXTPROC, eaglCreateNewContext, EGL_TRUE);
236-
GET_PROC(EAGLMAKECONTEXTCURRENTPROC, eaglMakeContextCurrent, EGL_TRUE);
237-
238235
#undef GET_PROC
239236

240237
EAGL_drv->handle = handle;

src/EGL/drivers/eagl/egl_eagl.m

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ static EGLBoolean _checkSurfaceAttribMatchConfigAttrib(_EGLSurface* surf, _EGLCo
115115
}
116116

117117
EAGL_dpy->Window = disp->PlatformDisplay;
118-
if (!EAGL_drv->eaglInitialize(EAGL_dpy, disp) || !EAGL_dpy->Window) {
118+
if (!EAGL_drv->Initialize(EAGL_dpy, disp) || !EAGL_dpy->Window) {
119119
_eglLog(_EGL_WARNING, "EAGL_eglInitialize");
120120
free(EAGL_dpy);
121121
return EGL_FALSE;
122122
}
123123

124-
if (!EAGL_drv->eaglQueryVersion(EAGL_dpy->Window,
124+
if (!EAGL_drv->QueryVersion(EAGL_dpy->Window,
125125
&EAGL_dpy->VersionMajor, &EAGL_dpy->VersionMinor)) {
126126
_eglLog(_EGL_WARNING, "EAGL_eglInitialize");
127127
if (!disp->PlatformDisplay) {
@@ -162,7 +162,7 @@ static EGLBoolean _checkSurfaceAttribMatchConfigAttrib(_EGLSurface* surf, _EGLCo
162162
struct EAGL_egl_display *EAGL_dpy = EAGL_egl_display(disp);
163163
struct EAGL_egl_driver *EAGL_drv = EAGL_egl_driver(drv);
164164

165-
EAGL_drv->eaglTerminate(EAGL_dpy);
165+
EAGL_drv->Terminate(EAGL_dpy);
166166

167167
_eglReleaseDisplayResources(drv, disp);
168168
_eglCleanupDisplay(disp);
@@ -207,7 +207,7 @@ static EGLBoolean _checkSurfaceAttribMatchConfigAttrib(_EGLSurface* surf, _EGLCo
207207
return NULL;
208208
}
209209

210-
if(!(EAGL_drv->eaglCreateContext(EAGL_dpy, EAGL_conf, EAGL_ctx_shared, attrib_list, EAGL_ctx))) {
210+
if(!(EAGL_drv->CreateContext(EAGL_dpy, EAGL_conf, EAGL_ctx_shared, attrib_list, EAGL_ctx))) {
211211
free(EAGL_ctx);
212212
return NULL;
213213
}
@@ -225,7 +225,7 @@ static EGLBoolean _checkSurfaceAttribMatchConfigAttrib(_EGLSurface* surf, _EGLCo
225225
struct EAGL_egl_context *EAGL_ctx = EAGL_egl_context(context);
226226

227227
assert(EAGL_ctx);
228-
EAGL_drv->eaglDestroyContext(EAGL_dpy->Window, EAGL_ctx);
228+
EAGL_drv->DestroyContext(EAGL_dpy->Window, EAGL_ctx);
229229
free(EAGL_ctx);
230230

231231
return EGL_TRUE;
@@ -256,7 +256,7 @@ static EGLBoolean _checkSurfaceAttribMatchConfigAttrib(_EGLSurface* surf, _EGLCo
256256
switch (surf->Type) {
257257
case EGL_WINDOW_BIT:
258258
{
259-
if (EAGL_drv->eaglDestroyWindow(EAGL_dpy, EAGL_surf)) {
259+
if (EAGL_drv->DestroyWindow(EAGL_dpy, EAGL_surf)) {
260260
free(EAGL_surf);
261261
return EGL_TRUE;
262262
}
@@ -297,7 +297,7 @@ static EGLBoolean _checkSurfaceAttribMatchConfigAttrib(_EGLSurface* surf, _EGLCo
297297
return EGL_FALSE;
298298
}
299299

300-
ret = EAGL_drv->eaglMakeCurrent(EAGL_dpy->Window, EAGL_dsurf, EAGL_ctx, &EAGL_ctx->OpenGLESAPI);
300+
ret = EAGL_drv->MakeCurrent(EAGL_dpy->Window, EAGL_dsurf, EAGL_ctx, &EAGL_ctx->OpenGLESAPI);
301301

302302
if (ret) {
303303
if (_eglPutSurface(old_dsurf))
@@ -387,7 +387,7 @@ static EGLBoolean _checkSurfaceAttribMatchConfigAttrib(_EGLSurface* surf, _EGLCo
387387
return NULL;
388388
}
389389

390-
if(!(EAGL_drv->eaglCreateWindow(EAGL_dpy, EAGL_conf, window, attrib_list, EAGL_surf))) {
390+
if(!(EAGL_drv->CreateWindow(EAGL_dpy, EAGL_conf, window, attrib_list, EAGL_surf))) {
391391
free(EAGL_surf);
392392
return NULL;
393393
}
@@ -515,7 +515,7 @@ static EGLBoolean EAGL_eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSu
515515
return _eglError(EGL_BAD_SURFACE, "EAGL_eglSwapBuffers");
516516
}
517517

518-
return EAGL_drv->eaglSwapBuffers(EAGL_dpy, EAGL_surf);
518+
return EAGL_drv->SwapBuffers(EAGL_dpy, EAGL_surf);
519519
}
520520

521521
/**
@@ -532,7 +532,7 @@ static EGLBoolean EAGL_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSu
532532

533533
_eglSwapInterval(drv, dpy, surf, interval);
534534

535-
return EAGL_drv->eaglSwapInterval(EAGL_dpy, EAGL_surf, interval);
535+
return EAGL_drv->SwapInterval(EAGL_dpy, EAGL_surf, interval);
536536
}
537537

538538
/*
@@ -543,7 +543,7 @@ static EGLBoolean EAGL_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSu
543543
{
544544
struct EAGL_egl_driver *EAGL_drv = EAGL_egl_driver(drv);
545545

546-
return (_EGLProc) EAGL_drv->eaglGetProcAddress((const char *) procname);
546+
return (_EGLProc) EAGL_drv->GetProcAddress((const char *) procname);
547547
}
548548

549549
/**
@@ -557,7 +557,7 @@ static EGLBoolean EAGL_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSu
557557
(void) dpy;
558558
(void) ctx;
559559

560-
EAGL_drv->eaglWaitGL();
560+
EAGL_drv->WaitGL();
561561
return EGL_TRUE;
562562
}
563563

@@ -573,7 +573,7 @@ static EGLBoolean EAGL_eglSwapInterval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSu
573573

574574
if (engine != EGL_CORE_NATIVE_ENGINE)
575575
return _eglError(EGL_BAD_PARAMETER, "eglWaitNative");
576-
EAGL_drv->eaglWaitNative();
576+
EAGL_drv->WaitNative();
577577
return EGL_TRUE;
578578
}
579579

0 commit comments

Comments
 (0)