aboutsummaryrefslogtreecommitdiff
path: root/platform/x11/context_gl_x11.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2015-10-25 20:09:18 -0300
committerJuan Linietsky2015-10-25 20:09:18 -0300
commitbd736e5af2ec5113c23fef58523f57a0b2e11fb2 (patch)
treee90bc27b9ba905ab94e8e5d3dfcf36b02a272883 /platform/x11/context_gl_x11.cpp
parent8f84f4117cafbf97605a4d3da5fcb80cec83cc99 (diff)
parent8949db75c3a3c30b5ffd4d8c177970306e4619a9 (diff)
downloadgodot-bd736e5af2ec5113c23fef58523f57a0b2e11fb2.tar.gz
godot-bd736e5af2ec5113c23fef58523f57a0b2e11fb2.tar.zst
godot-bd736e5af2ec5113c23fef58523f57a0b2e11fb2.zip
Diffstat (limited to 'platform/x11/context_gl_x11.cpp')
-rw-r--r--platform/x11/context_gl_x11.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index dc0dc063b..3db1f6da2 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -46,7 +46,6 @@ struct ContextGL_X11_Private {
::GLXContext glx_context;
};
-
void ContextGL_X11::release_current() {
glXMakeCurrent(x11_display, None, NULL);
@@ -56,10 +55,12 @@ void ContextGL_X11::make_current() {
glXMakeCurrent(x11_display, x11_window, p->glx_context);
}
+
void ContextGL_X11::swap_buffers() {
glXSwapBuffers(x11_display,x11_window);
}
+
/*
static GLWrapperFuncPtr wrapper_get_proc_address(const char* p_function) {
@@ -154,6 +155,9 @@ Error ContextGL_X11::initialize() {
*/
//glXMakeCurrent(x11_display, None, NULL);
+ XFree( vi );
+ XFree( fbc );
+
return OK;
}
@@ -164,12 +168,12 @@ int ContextGL_X11::get_window_width() {
return xwa.width;
}
+
int ContextGL_X11::get_window_height() {
XWindowAttributes xwa;
XGetWindowAttributes(x11_display,x11_window,&xwa);
return xwa.height;
-
}
@@ -189,6 +193,8 @@ ContextGL_X11::ContextGL_X11(::Display *p_x11_display,::Window &p_x11_window,con
ContextGL_X11::~ContextGL_X11() {
+ release_current();
+ glXDestroyContext( x11_display, p->glx_context );
memdelete( p );
}