forked from joejulian/gio
gpu/headless: remove macOS context preparation no longer necessary
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -16,13 +16,11 @@ __attribute__ ((visibility ("hidden"))) CFTypeRef gio_headless_newContext(void);
|
|||||||
__attribute__ ((visibility ("hidden"))) void gio_headless_releaseContext(CFTypeRef ctxRef);
|
__attribute__ ((visibility ("hidden"))) void gio_headless_releaseContext(CFTypeRef ctxRef);
|
||||||
__attribute__ ((visibility ("hidden"))) void gio_headless_clearCurrentContext(CFTypeRef ctxRef);
|
__attribute__ ((visibility ("hidden"))) void gio_headless_clearCurrentContext(CFTypeRef ctxRef);
|
||||||
__attribute__ ((visibility ("hidden"))) void gio_headless_makeCurrentContext(CFTypeRef ctxRef);
|
__attribute__ ((visibility ("hidden"))) void gio_headless_makeCurrentContext(CFTypeRef ctxRef);
|
||||||
__attribute__ ((visibility ("hidden"))) void gio_headless_prepareContext(CFTypeRef ctxRef);
|
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
type nsContext struct {
|
type nsContext struct {
|
||||||
ctx C.CFTypeRef
|
ctx C.CFTypeRef
|
||||||
prepared bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func newGLContext() (context, error) {
|
func newGLContext() (context, error) {
|
||||||
@@ -36,10 +34,6 @@ func (c *nsContext) API() gpu.API {
|
|||||||
|
|
||||||
func (c *nsContext) MakeCurrent() error {
|
func (c *nsContext) MakeCurrent() error {
|
||||||
C.gio_headless_makeCurrentContext(c.ctx)
|
C.gio_headless_makeCurrentContext(c.ctx)
|
||||||
if !c.prepared {
|
|
||||||
C.gio_headless_prepareContext(c.ctx)
|
|
||||||
c.prepared = true
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,3 @@ void gio_headless_makeCurrentContext(CFTypeRef ctxRef) {
|
|||||||
EAGLContext *ctx = (__bridge EAGLContext *)ctxRef;
|
EAGLContext *ctx = (__bridge EAGLContext *)ctxRef;
|
||||||
[EAGLContext setCurrentContext:ctx];
|
[EAGLContext setCurrentContext:ctx];
|
||||||
}
|
}
|
||||||
|
|
||||||
void gio_headless_prepareContext(CFTypeRef ctxRef) {
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -43,11 +43,3 @@ void gio_headless_makeCurrentContext(CFTypeRef ctxRef) {
|
|||||||
[ctx makeCurrentContext];
|
[ctx makeCurrentContext];
|
||||||
CGLLockContext([ctx CGLContextObj]);
|
CGLLockContext([ctx CGLContextObj]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gio_headless_prepareContext(CFTypeRef ctxRef) {
|
|
||||||
// Bind a default VBA to emulate OpenGL ES 2.
|
|
||||||
GLuint defVBA;
|
|
||||||
glGenVertexArrays(1, &defVBA);
|
|
||||||
glBindVertexArray(defVBA);
|
|
||||||
glEnable(GL_FRAMEBUFFER_SRGB);
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user