mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
examples/sdlshare: Port to SDL2
This commit is contained in:
parent
b0bd448d37
commit
6a5ab50103
4 changed files with 77 additions and 108 deletions
|
@ -1134,7 +1134,7 @@ AC_DEFUN([AG_GST_GL_EXAMPLES_CHECKS],
|
||||||
dnl sdl is optional and used in examples
|
dnl sdl is optional and used in examples
|
||||||
HAVE_SDL=NO
|
HAVE_SDL=NO
|
||||||
if test "x$BUILD_EXAMPLES" = "xyes"; then
|
if test "x$BUILD_EXAMPLES" = "xyes"; then
|
||||||
PKG_CHECK_MODULES(SDL, sdl >= 1.2.0, HAVE_SDL=yes, HAVE_SDL=no)
|
PKG_CHECK_MODULES(SDL, sdl2, HAVE_SDL=yes, HAVE_SDL=no)
|
||||||
AC_SUBST(SDL_LIBS)
|
AC_SUBST(SDL_LIBS)
|
||||||
AC_SUBST(SDL_CFLAGS)
|
AC_SUBST(SDL_CFLAGS)
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
sdl_dep = dependency('sdl', version : '>=1.2.0', required : get_option('examples'))
|
sdl_dep = dependency('sdl2', version : '>=2.0', required : get_option('examples'))
|
||||||
have_sdl_gl = build_gstgl and (
|
have_sdl_gl = build_gstgl and (
|
||||||
enabled_gl_apis.contains('gl') and
|
enabled_gl_apis.contains('gl') and
|
||||||
(enabled_gl_platforms.contains('glx') or enabled_gl_platforms.contains('wgl')) and
|
(enabled_gl_platforms.contains('glx') or enabled_gl_platforms.contains('wgl')) and
|
||||||
|
|
|
@ -26,12 +26,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include "SDL/SDL.h"
|
#include <SDL2/SDL.h>
|
||||||
#include "SDL/SDL_opengl.h"
|
#include <SDL2/SDL_opengl.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
#include "SDL/SDL_syswm.h"
|
#include <SDL2/SDL_syswm.h>
|
||||||
#include <gst/gl/x11/gstgldisplay_x11.h>
|
#include <gst/gl/x11/gstgldisplay_x11.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -41,9 +41,12 @@
|
||||||
static GstGLContext *sdl_context;
|
static GstGLContext *sdl_context;
|
||||||
static GstGLDisplay *sdl_gl_display;
|
static GstGLDisplay *sdl_gl_display;
|
||||||
|
|
||||||
static GAsyncQueue *queue_input_buf = NULL;
|
static SDL_Window *sdl_window;
|
||||||
static GAsyncQueue *queue_output_buf = NULL;
|
static SDL_GLContext sdl_gl_context;
|
||||||
static GMainLoop *loop = NULL;
|
|
||||||
|
static GAsyncQueue *queue_input_buf;
|
||||||
|
static GAsyncQueue *queue_output_buf;
|
||||||
|
static GMainLoop *loop;
|
||||||
|
|
||||||
/* rotation angle for the triangle. */
|
/* rotation angle for the triangle. */
|
||||||
float rtri = 0.0f;
|
float rtri = 0.0f;
|
||||||
|
@ -132,7 +135,7 @@ DrawGLScene (GstBuffer * buf)
|
||||||
rquad -= 1.0f; // Decrease The Rotation Variable For The Quad
|
rquad -= 1.0f; // Decrease The Rotation Variable For The Quad
|
||||||
|
|
||||||
// swap buffers to display, since we're double buffered.
|
// swap buffers to display, since we're double buffered.
|
||||||
SDL_GL_SwapBuffers ();
|
SDL_GL_SwapWindow (sdl_window);
|
||||||
|
|
||||||
gst_video_frame_unmap (&v_frame);
|
gst_video_frame_unmap (&v_frame);
|
||||||
}
|
}
|
||||||
|
@ -154,7 +157,9 @@ update_sdl_scene (gpointer data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_GL_MakeCurrent (sdl_window, sdl_gl_context);
|
||||||
DrawGLScene (buf);
|
DrawGLScene (buf);
|
||||||
|
SDL_GL_MakeCurrent (sdl_window, NULL);
|
||||||
|
|
||||||
/* push buffer so it can be unref later */
|
/* push buffer so it can be unref later */
|
||||||
g_async_queue_push (queue_output_buf, buf);
|
g_async_queue_push (queue_output_buf, buf);
|
||||||
|
@ -266,13 +271,12 @@ main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
HGLRC sdl_gl_context = 0;
|
HGLRC gl_context = 0;
|
||||||
HDC sdl_dc = 0;
|
HDC sdl_dc = 0;
|
||||||
#else
|
#else
|
||||||
SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
Display *sdl_display = NULL;
|
Display *sdl_display = NULL;
|
||||||
Window sdl_win = 0;
|
GLXContext gl_context = NULL;
|
||||||
GLXContext sdl_gl_context = NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GstPipeline *pipeline = NULL;
|
GstPipeline *pipeline = NULL;
|
||||||
|
@ -287,47 +291,44 @@ main (int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a 640x480 OpenGL screen */
|
/* Create a 640x480 OpenGL window */
|
||||||
if (SDL_SetVideoMode (640, 480, 0, SDL_OPENGL) == NULL) {
|
sdl_window =
|
||||||
|
SDL_CreateWindow ("SDL and gst-plugins-gl", SDL_WINDOWPOS_UNDEFINED,
|
||||||
|
SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL);
|
||||||
|
if (sdl_window == NULL) {
|
||||||
fprintf (stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError ());
|
fprintf (stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError ());
|
||||||
SDL_Quit ();
|
SDL_Quit ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the title bar in environments that support it */
|
sdl_gl_context = SDL_GL_CreateContext (sdl_window);
|
||||||
SDL_WM_SetCaption ("SDL and gst-plugins-gl", NULL);
|
|
||||||
|
|
||||||
|
|
||||||
/* Loop, drawing and checking events */
|
|
||||||
InitGL (640, 480);
|
|
||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
|
||||||
/* retrieve and turn off sdl opengl context */
|
SDL_GL_MakeCurrent (sdl_window, sdl_gl_context);
|
||||||
|
|
||||||
|
/* Loop, drawing and checking events */
|
||||||
|
InitGL (640, 480);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
sdl_gl_context = wglGetCurrentContext ();
|
gl_context = wglGetCurrentContext ();
|
||||||
sdl_dc = wglGetCurrentDC ();
|
sdl_dc = wglGetCurrentDC ();
|
||||||
wglMakeCurrent (0, 0);
|
|
||||||
platform = "wgl";
|
platform = "wgl";
|
||||||
sdl_gl_display = gst_gl_display_new ();
|
sdl_gl_display = gst_gl_display_new ();
|
||||||
#else
|
#else
|
||||||
SDL_VERSION (&info.version);
|
SDL_VERSION (&info.version);
|
||||||
SDL_GetWMInfo (&info);
|
SDL_GetWindowWMInfo (sdl_window, &info);
|
||||||
/* FIXME: This display is different to the one that SDL uses to create the
|
sdl_display = info.info.x11.display;
|
||||||
* GL context inside SDL_SetVideoMode() above which fails on Intel hardware
|
gl_context = glXGetCurrentContext ();
|
||||||
*/
|
|
||||||
sdl_display = info.info.x11.gfxdisplay;
|
|
||||||
sdl_win = info.info.x11.window;
|
|
||||||
sdl_gl_context = glXGetCurrentContext ();
|
|
||||||
glXMakeCurrent (sdl_display, None, 0);
|
|
||||||
platform = "glx";
|
platform = "glx";
|
||||||
sdl_gl_display =
|
sdl_gl_display =
|
||||||
(GstGLDisplay *) gst_gl_display_x11_new_with_display (sdl_display);
|
(GstGLDisplay *) gst_gl_display_x11_new_with_display (sdl_display);
|
||||||
#endif
|
#endif
|
||||||
|
SDL_GL_MakeCurrent (sdl_window, NULL);
|
||||||
|
|
||||||
sdl_context =
|
sdl_context =
|
||||||
gst_gl_context_new_wrapped (sdl_gl_display, (guintptr) sdl_gl_context,
|
gst_gl_context_new_wrapped (sdl_gl_display, (guintptr) gl_context,
|
||||||
gst_gl_platform_from_string (platform), GST_GL_API_OPENGL);
|
gst_gl_platform_from_string (platform), GST_GL_API_OPENGL);
|
||||||
|
|
||||||
pipeline =
|
pipeline =
|
||||||
|
@ -355,13 +356,6 @@ main (int argc, char **argv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* turn on back sdl opengl context */
|
|
||||||
#ifdef WIN32
|
|
||||||
wglMakeCurrent (sdl_dc, sdl_gl_context);
|
|
||||||
#else
|
|
||||||
glXMakeCurrent (sdl_display, sdl_win, sdl_gl_context);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
queue_input_buf = g_async_queue_new ();
|
queue_input_buf = g_async_queue_new ();
|
||||||
queue_output_buf = g_async_queue_new ();
|
queue_output_buf = g_async_queue_new ();
|
||||||
|
|
||||||
|
@ -375,15 +369,6 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
g_main_loop_run (loop);
|
g_main_loop_run (loop);
|
||||||
|
|
||||||
/* before to deinitialize the gst-gl-opengl context,
|
|
||||||
* no shared context (here the sdl one) must be current
|
|
||||||
*/
|
|
||||||
#ifdef WIN32
|
|
||||||
wglMakeCurrent (0, 0);
|
|
||||||
#else
|
|
||||||
glXMakeCurrent (sdl_display, sdl_win, sdl_gl_context);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
|
|
||||||
|
@ -406,12 +391,9 @@ main (int argc, char **argv)
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* turn on back sdl opengl context */
|
SDL_GL_DeleteContext (gl_context);
|
||||||
#ifdef WIN32
|
|
||||||
wglMakeCurrent (sdl_dc, sdl_gl_context);
|
SDL_DestroyWindow (sdl_window);
|
||||||
#else
|
|
||||||
glXMakeCurrent (sdl_display, None, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_Quit ();
|
SDL_Quit ();
|
||||||
|
|
||||||
|
|
|
@ -26,12 +26,12 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include "SDL/SDL.h"
|
#include <SDL2/SDL.h>
|
||||||
#include "SDL/SDL_opengl.h"
|
#include <SDL2/SDL_opengl.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
#include "SDL/SDL_syswm.h"
|
#include <SDL2/SDL_syswm.h>
|
||||||
#include <gst/gl/x11/gstgldisplay_x11.h>
|
#include <gst/gl/x11/gstgldisplay_x11.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -41,11 +41,14 @@
|
||||||
static GstGLContext *sdl_context;
|
static GstGLContext *sdl_context;
|
||||||
static GstGLDisplay *sdl_gl_display;
|
static GstGLDisplay *sdl_gl_display;
|
||||||
|
|
||||||
|
static SDL_Window *sdl_window;
|
||||||
|
static SDL_GLContext sdl_gl_context;
|
||||||
|
|
||||||
/* rotation angle for the triangle. */
|
/* rotation angle for the triangle. */
|
||||||
float rtri = 0.0f;
|
static float rtri = 0.0f;
|
||||||
|
|
||||||
/* rotation angle for the quadrilateral. */
|
/* rotation angle for the quadrilateral. */
|
||||||
float rquad = 0.0f;
|
static float rquad = 0.0f;
|
||||||
|
|
||||||
/* A general OpenGL initialization function. Sets all of the initial parameters. */
|
/* A general OpenGL initialization function. Sets all of the initial parameters. */
|
||||||
static void
|
static void
|
||||||
|
@ -127,7 +130,7 @@ DrawGLScene (GstVideoFrame * v_frame)
|
||||||
rquad -= 1.0f; // Decrease The Rotation Variable For The Quad
|
rquad -= 1.0f; // Decrease The Rotation Variable For The Quad
|
||||||
|
|
||||||
// swap buffers to display, since we're double buffered.
|
// swap buffers to display, since we're double buffered.
|
||||||
SDL_GL_SwapBuffers ();
|
SDL_GL_SwapWindow (sdl_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GMutex app_lock;
|
static GMutex app_lock;
|
||||||
|
@ -154,17 +157,17 @@ update_sdl_scene (gpointer data)
|
||||||
while (SDL_PollEvent (&event)) {
|
while (SDL_PollEvent (&event)) {
|
||||||
if (event.type == SDL_QUIT) {
|
if (event.type == SDL_QUIT) {
|
||||||
stop_pipeline (pipeline);
|
stop_pipeline (pipeline);
|
||||||
return FALSE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
if (event.type == SDL_KEYDOWN) {
|
if (event.type == SDL_KEYDOWN) {
|
||||||
if (event.key.keysym.sym == SDLK_ESCAPE) {
|
if (event.key.keysym.sym == SDLK_ESCAPE) {
|
||||||
stop_pipeline (pipeline);
|
stop_pipeline (pipeline);
|
||||||
return FALSE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return G_SOURCE_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -172,8 +175,11 @@ executeCallback (gpointer data)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&app_lock);
|
g_mutex_lock (&app_lock);
|
||||||
|
|
||||||
if (!app_quit)
|
if (!app_quit) {
|
||||||
|
SDL_GL_MakeCurrent (sdl_window, sdl_gl_context);
|
||||||
DrawGLScene (data);
|
DrawGLScene (data);
|
||||||
|
SDL_GL_MakeCurrent (sdl_window, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
app_rendered = TRUE;
|
app_rendered = TRUE;
|
||||||
g_cond_signal (&app_cond);
|
g_cond_signal (&app_cond);
|
||||||
|
@ -285,13 +291,12 @@ int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
HGLRC sdl_gl_context = 0;
|
HGLRC gl_context = 0;
|
||||||
HDC sdl_dc = 0;
|
HDC sdl_dc = 0;
|
||||||
#else
|
#else
|
||||||
SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
Display *sdl_display = NULL;
|
Display *sdl_display = NULL;
|
||||||
Window sdl_win = 0;
|
GLXContext gl_context = NULL;
|
||||||
GLXContext sdl_gl_context = NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GMainLoop *loop = NULL;
|
GMainLoop *loop = NULL;
|
||||||
|
@ -307,46 +312,47 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a 640x480 OpenGL screen */
|
/* Create a 640x480 OpenGL screen */
|
||||||
if (SDL_SetVideoMode (640, 480, 0, SDL_OPENGL) == NULL) {
|
sdl_window =
|
||||||
|
SDL_CreateWindow ("SDL and gst-plugins-gl", SDL_WINDOWPOS_UNDEFINED,
|
||||||
|
SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL);
|
||||||
|
if (sdl_window == NULL) {
|
||||||
fprintf (stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError ());
|
fprintf (stderr, "Unable to create OpenGL screen: %s\n", SDL_GetError ());
|
||||||
SDL_Quit ();
|
SDL_Quit ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the title bar in environments that support it */
|
sdl_gl_context = SDL_GL_CreateContext (sdl_window);
|
||||||
SDL_WM_SetCaption ("SDL and gst-plugins-gl", NULL);
|
if (sdl_gl_context == NULL) {
|
||||||
|
fprintf (stderr, "Unable to create OpenGL context: %s\n", SDL_GetError ());
|
||||||
|
SDL_Quit ();
|
||||||
/* Loop, drawing and checking events */
|
return -1;
|
||||||
InitGL (640, 480);
|
}
|
||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
|
||||||
/* retrieve and turn off sdl opengl context */
|
SDL_GL_MakeCurrent (sdl_window, sdl_gl_context);
|
||||||
|
|
||||||
|
/* Loop, drawing and checking events */
|
||||||
|
InitGL (640, 480);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
sdl_gl_context = wglGetCurrentContext ();
|
gl_context = wglGetCurrentContext ();
|
||||||
sdl_dc = wglGetCurrentDC ();
|
sdl_dc = wglGetCurrentDC ();
|
||||||
wglMakeCurrent (0, 0);
|
|
||||||
platform = "wgl";
|
platform = "wgl";
|
||||||
sdl_gl_display = gst_gl_display_new ();
|
sdl_gl_display = gst_gl_display_new ();
|
||||||
#else
|
#else
|
||||||
SDL_VERSION (&info.version);
|
SDL_VERSION (&info.version);
|
||||||
SDL_GetWMInfo (&info);
|
SDL_GetWindowWMInfo (sdl_window, &info);
|
||||||
/* FIXME: This display is different to the one that SDL uses to create the
|
sdl_display = info.info.x11.display;
|
||||||
* GL context inside SDL_SetVideoMode() above which fails on Intel hardware
|
gl_context = glXGetCurrentContext ();
|
||||||
*/
|
|
||||||
sdl_display = info.info.x11.gfxdisplay;
|
|
||||||
sdl_win = info.info.x11.window;
|
|
||||||
sdl_gl_context = glXGetCurrentContext ();
|
|
||||||
glXMakeCurrent (sdl_display, None, 0);
|
|
||||||
platform = "glx";
|
platform = "glx";
|
||||||
sdl_gl_display =
|
sdl_gl_display =
|
||||||
(GstGLDisplay *) gst_gl_display_x11_new_with_display (sdl_display);
|
(GstGLDisplay *) gst_gl_display_x11_new_with_display (sdl_display);
|
||||||
#endif
|
#endif
|
||||||
|
SDL_GL_MakeCurrent (sdl_window, NULL);
|
||||||
|
|
||||||
sdl_context =
|
sdl_context =
|
||||||
gst_gl_context_new_wrapped (sdl_gl_display, (guintptr) sdl_gl_context,
|
gst_gl_context_new_wrapped (sdl_gl_display, (guintptr) gl_context,
|
||||||
gst_gl_platform_from_string (platform), GST_GL_API_OPENGL);
|
gst_gl_platform_from_string (platform), GST_GL_API_OPENGL);
|
||||||
|
|
||||||
pipeline =
|
pipeline =
|
||||||
|
@ -371,28 +377,12 @@ main (int argc, char **argv)
|
||||||
* shared with the sdl one */
|
* shared with the sdl one */
|
||||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED);
|
||||||
|
|
||||||
/* turn on back sdl opengl context */
|
|
||||||
#ifdef WIN32
|
|
||||||
wglMakeCurrent (sdl_dc, sdl_gl_context);
|
|
||||||
#else
|
|
||||||
glXMakeCurrent (sdl_display, sdl_win, sdl_gl_context);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
|
||||||
|
|
||||||
g_timeout_add (100, update_sdl_scene, pipeline);
|
g_timeout_add (100, update_sdl_scene, pipeline);
|
||||||
|
|
||||||
g_main_loop_run (loop);
|
g_main_loop_run (loop);
|
||||||
|
|
||||||
/* before to deinitialize the gst-gl-opengl context,
|
|
||||||
* no shared context (here the sdl one) must be current
|
|
||||||
*/
|
|
||||||
#ifdef WIN32
|
|
||||||
wglMakeCurrent (0, 0);
|
|
||||||
#else
|
|
||||||
glXMakeCurrent (sdl_display, sdl_win, sdl_gl_context);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
||||||
gst_object_unref (pipeline);
|
gst_object_unref (pipeline);
|
||||||
|
|
||||||
|
@ -402,12 +392,9 @@ main (int argc, char **argv)
|
||||||
gst_object_unref (sdl_context);
|
gst_object_unref (sdl_context);
|
||||||
gst_object_unref (sdl_gl_display);
|
gst_object_unref (sdl_gl_display);
|
||||||
|
|
||||||
/* turn on back sdl opengl context */
|
SDL_GL_DeleteContext (gl_context);
|
||||||
#ifdef WIN32
|
|
||||||
wglMakeCurrent (sdl_dc, sdl_gl_context);
|
SDL_DestroyWindow (sdl_window);
|
||||||
#else
|
|
||||||
glXMakeCurrent (sdl_display, None, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SDL_Quit ();
|
SDL_Quit ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue