18 Commits 528dd1f1f0 ... 7e83f70741

Author SHA1 Message Date
  Niels Nesse 7e83f70741 Use TLS for context data on Linux too 9 years ago
  Niels Nesse 1d3905a53f Examples: Show window after context setup 9 years ago
  Niels Nesse 9c33a3ee08 Windows: Test fullscreen support in simple window test 9 years ago
  Niels Nesse 75fecc0dbf Center text in text rendering test 9 years ago
  Niels Nesse dc4b32099e Windows: Support button modifier query functions 9 years ago
  Niels Nesse e653c442fe Windows: Use black background instead of white 9 years ago
  Niels Nesse 6c03813177 Windows: fullscreen support 9 years ago
  Niels Nesse a80b6f3590 Include text renderer cleanup function for later user 9 years ago
  Niels Nesse 0ab8b30c2a Make Linux match key values generated on windows 9 years ago
  Niels Nesse 21ceda4b2b Initialize text renderer completely at first text API call 9 years ago
  Niels Nesse 99d3f0711b Remove renderer type and make it part of the current context instead 9 years ago
  Niels Nesse 40a1da179f Windows: Allow cursor to be set correctly while insode the non-client area 9 years ago
  Niels Nesse 373e89cfda Align text differently to demonstrate the API better 9 years ago
  Niels Nesse 91c2dd6418 Don't disable text rendering by default for MinGW anymore 9 years ago
  Niels Nesse 2525fd290e Make autotools happy by using an m4 directory 9 years ago
  Niels Nesse 617f7ff35e Describe text rendering in main readme and remove readme in text directory 9 years ago
  Niels Nesse 9474a38f36 Text: Compute advancement differently when there is no next glyph 9 years ago
  Niels Nesse 021e25e23f Fixing incorrect example code in readme 9 years ago
10 changed files with 200 additions and 57 deletions
  1. 6 0
      Makefile.am
  2. 16 1
      Readme.md
  3. 2 4
      configure.ac
  4. 2 0
      m4/dummy
  5. 4 9
      src/examples/simple_window.c
  6. 17 11
      src/examples/text_render.c
  7. 62 14
      src/glplatform-linux.c
  8. 89 18
      src/glplatform-win32.c
  9. 2 0
      src/glplatform.h
  10. 0 0
      src/glplatform_priv.h

+ 6 - 0
Makefile.am

@@ -1,3 +1,5 @@
+ACLOCAL_AMFLAGS=-I m4
+
 AM_CPPFLAGS = -I$(top_srcdir)/src \
 	      -I$(top_srcdir)/src/glbindings
 
@@ -17,11 +19,15 @@ libglplatform_la_SOURCES = src/glbindings/glplatform-glcore.c
 if WINDOWS
 libglplatform_la_SOURCES += src/glplatform-win32.c \
 			   src/glbindings/glplatform-wgl.c
+libglplatform_la_CFLAGS += -DGLPLATFORM_ENABLE_WGL_ARB_create_context \
+			-DGLPLATFORM_ENABLE_WGL_ARB_create_context_profile
 endif
 
 if LINUX_GNU
 libglplatform_la_SOURCES += src/glplatform-linux.c \
 			   src/glbindings/glplatform-glx.c
+libglplatform_la_CFLAGS += -DGLPLATFORM_ENABLE_GLX_ARB_create_context \
+			-DGLPLATFORM_ENABLE_GLX_ARB_create_context_profile
 endif
 
 if WITH_MATH3D

+ 16 - 1
Readme.md

@@ -52,7 +52,7 @@ When creating a context you must specify which OpenGL version your application r
 
 Example: Creating a OpenGL 3.3 core profile compatible context
 
-	struct glplatform_win *win = glplatform_create_window("Hello window", &cb, 512, 512);
+	struct glplatform_win *win = glplatform_create_window("Hello window", &cb, NULL, 512, 512);
 
 	//...
 
@@ -90,6 +90,21 @@ Example: Initializing OpenGL bindings
 See the `glbindify` documentation for details. Note that `glplatform` uses the namespace feature of `glbindify` so where the documentation refers to `glb` or `GLB` you should substitute `glplatform` or `GLPLATFORM`
 respectively.
 
+Text rendering
+--------------
+
+glplatform contains a text renderer that
+
+- Is data Driven for minimal driver overhead
+
+- Works on OpenGL 3.x and higher
+
+- Uses libfreetype for text rasterization
+
+glplatform's text renderer can render transformed text with minimal distortion as well as render untransformed text with high quality anti-aliasing. Its design focuses on simplicity, performance, and control.
+
+To render text an application first requests an array of glyph instance structures. The application must then fill the entries with glyph positions and glyph identifiers. Finally the application submits the draw specifying the color and transform to perform the rendering with. Glyph metrics and kerning information that can be queried from the API to help the application layout the glyphs. The render call supports rotation and scaling of the text in three dimentions.
+
 Building
 --------
 

+ 2 - 4
configure.ac

@@ -1,6 +1,8 @@
 AC_PREREQ(2.59)
 AC_INIT(glplatform, 0.3)
 
+AC_CONFIG_MACRO_DIRS([m4])
+
 AC_CANONICAL_SYSTEM
 
 AM_INIT_AUTOMAKE([foreign subdir-objects])
@@ -15,10 +17,6 @@ if test x$enable_math3d = x; then
 	enable_math3d="yes"
 fi
 
-if test $host_os = 'mingw32'; then
-	enable_text="no"
-fi
-
 AS_IF([ test $enable_text = yes ],
 	[PKG_CHECK_MODULES(FREETYPE2,freetype2 >= 2.53, [ enable_text="yes" ], [ enable_text="no" ])])
 

+ 2 - 0
m4/dummy

@@ -0,0 +1,2 @@
+This file added so that the m4 directory can be added to git to keep autotools
+happy. It should be removed if any m4 files are added here.

+ 4 - 9
src/examples/simple_window.c

@@ -6,18 +6,13 @@
 #ifdef _WIN32
 #include <windows.h>
 #endif
-
 bool fullscreen = false;
 
 void on_key_down(struct glplatform_win *win, int k)
 {
-	//TODO: No fullscreen support for windows yet
-#ifndef _WIN32
-	if (k == 'f') {
-		fullscreen = !fullscreen;
-		glplatform_fullscreen_win(win, fullscreen);
+	if (k == 'F') {
+		glplatform_fullscreen_win(win, !win->fullscreen);
 	}
-#endif
 }
 
 void on_destroy(struct glplatform_win *win)
@@ -25,6 +20,7 @@ void on_destroy(struct glplatform_win *win)
 	glplatform_destroy_window(win);
 }
 
+
 #if defined(_WIN32)
 int CALLBACK WinMain(
 	HINSTANCE hInstance,
@@ -46,7 +42,6 @@ int main()
 	if (!win)
 		exit(-1);
 
-	glplatform_show_window(win);
 	glplatform_gl_context_t ctx = glplatform_create_context(win, 3, 3);
 	if (!ctx)
 		exit(-1);
@@ -54,11 +49,11 @@ int main()
 	if (!glplatform_glcore_init(3, 3)) {
 		exit(-1);
 	}
+	glplatform_show_window(win);
 	while (glplatform_process_events()) {
 		glClearColor(0,0,1,1);
 		glClear(GL_COLOR_BUFFER_BIT);
 		glplatform_swap_buffers(win);
-
 		if (glplatform_get_events(true) < 0)
 			break;
 	}

+ 17 - 11
src/examples/text_render.c

@@ -24,14 +24,16 @@ int CALLBACK WinMain(
 int main()
 #endif
 {
-	gltext_renderer_t renderer;
 	gltext_font_t font;
 
 	struct glplatform_win_callbacks cb = {
 		.on_destroy = on_destroy
 	};
 
-	renderer = gltext_renderer_new(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'\"0123456789`~!@#$%^&*()_+;/?.>,<={}[]\\");
+
+	const char *charset = " abcdefghijklmnopqrstuvwxyz"
+		"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+		"'\"0123456789`~!@#$%^&*()_+;/?.>,<={}[]\\";
 
 	if (!glplatform_init()) {
 		fprintf(stderr, "Failed to initialize GL window manager\n");
@@ -43,7 +45,6 @@ int main()
 		fprintf(stderr, "Failed to create OpenGL window\n");
 		exit(-1);
 	}
-	glplatform_show_window(win);
 	glplatform_gl_context_t ctx = glplatform_create_context(win, 3, 3);
 	if (!ctx) {
 		fprintf(stderr, "Failed to create OpenGL context\n");
@@ -52,11 +53,15 @@ int main()
 	glplatform_make_current(win, ctx);
 	glplatform_glcore_init(3, 3);
 
-	font = gltext_font_create(renderer, gltext_renderer_get_typeface(renderer, TTF_PATH "LiberationSans-Regular.ttf"), 20);
+	font = gltext_font_create(charset,
+		gltext_get_typeface(TTF_PATH "LiberationSans-Regular.ttf"),
+		20);
+
 	if (!font) {
 		fprintf(stderr, "Failed to create font\n");
 		exit(-1);
 	}
+	glplatform_show_window(win);
 
 	while (glplatform_process_events()) {
 		int width, height;
@@ -65,14 +70,9 @@ int main()
 		glViewport(0, 0, width, height);
 		glClearColor(0,0,0,1);
 		glClear(GL_COLOR_BUFFER_BIT);
-		float mvp[16] = {
-			2.0f/width,0,0,0,
-			0,-2.0f/height,0,0,
-			0,0,1,0,
-			-1,0,0,1};
 
 		const char *str = "The quick brown fox jumps over the lazy dog()'\"0123456789`~!@#$%^&*()_+;/?.>,<={}[]\\";
-		struct gltext_glyph_instance *r = gltext_renderer_prepare_render(renderer, font, (int)strlen(str));
+		struct gltext_glyph_instance *r = gltext_prepare_render(font, (int)strlen(str));
 
 		const struct gltext_glyph *g_prev = NULL;
 		float x_pos = 0;
@@ -93,7 +93,13 @@ int main()
 			str++;
 			g_prev = g_cur;
 		}
-		gltext_renderer_submit_render(renderer, &color, mvp);
+		x_pos += gltext_get_advance(g_prev, NULL);
+		float mvp[16] = {
+			2.0f/width,0,0,0,
+			0,-2.0f/height,0,0,
+			0,0,1,0,
+			-1 + ((width - x_pos)/2)*(2.0f/width),1 + (height/2)*(-2.0f/height),0,1};
+		gltext_submit_render(&color, mvp);
 		glplatform_swap_buffers(win);
 
 		if (glplatform_get_events(true) < 0)

+ 62 - 14
src/glplatform-linux.c

@@ -7,12 +7,13 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <errno.h>
-
-#define GLPLATFORM_ENABLE_GLX_ARB_create_context
-#define GLPLATFORM_ENABLE_GLX_ARB_create_context_profile
+#include <pthread.h>
+#include <ctype.h>
+#include <unistd.h>
 #include "glplatform-glx.h"
+#include "glplatform_priv.h"
 
-int glplatform_epoll_fd;
+int glplatform_epoll_fd = -1;
 
 static int g_x11_fd;
 static int g_event_count;
@@ -32,6 +33,8 @@ struct fd_binding {
 
 static struct fd_binding *g_fd_binding;
 
+static pthread_key_t g_context_tls;
+
 static struct glplatform_win *find_glplatform_win(Window w)
 {
 	struct glplatform_win *win = g_win_list;
@@ -125,18 +128,22 @@ static int handle_x_event(struct glplatform_win *win, XEvent *event)
 		XKeyEvent *key_event = (XKeyEvent *)event;
 		KeySym k;
 		win->x_state_mask = key_event->state;
-		XLookupString(key_event, buf, 20, &k, NULL);
+		XKeyEvent key_event_copy = *((XKeyEvent *)event);
+		key_event_copy.state = 0;
+		XLookupString(&key_event_copy, buf, 20, &k, NULL);
 		if (win->callbacks.on_key_down)
-			win->callbacks.on_key_down(win, k);
+			win->callbacks.on_key_down(win, toupper(k));
 	} break;
 	case KeyRelease: {
 		char buf[20];
 		XKeyEvent *key_event = (XKeyEvent *)event;
 		KeySym k;
 		win->x_state_mask = key_event->state;
-		XLookupString(key_event, buf, 20, &k, NULL);
+		XKeyEvent key_event_copy = *((XKeyEvent *)event);
+		key_event_copy.state = 0;
+		XLookupString(&key_event_copy, buf, 20, &k, NULL);
 		if (win->callbacks.on_key_up)
-			win->callbacks.on_key_up(win, k);
+			win->callbacks.on_key_up(win, toupper(k));
 	} break;
 	case ButtonPress: {
 		XButtonEvent *button_event = (XButtonEvent *)event;
@@ -201,31 +208,58 @@ static int handle_x_event(struct glplatform_win *win, XEvent *event)
 
 bool glplatform_init()
 {
+	int rc;
 	g_event_count = 0;
+	if (pthread_key_create(&g_context_tls, NULL))
+		return false;
+
 	glplatform_epoll_fd = epoll_create1(0);
+	if (glplatform_epoll_fd == -1)
+		goto error1;
+
 	g_display = XOpenDisplay(NULL);
+	if (g_display == NULL)
+		goto error2;
+
 	g_x11_fd = XConnectionNumber(g_display);
 	glplatform_glx_init(1, 4);
 
 	struct rlimit rl;
-	int rc = getrlimit(RLIMIT_NOFILE, &rl);
+	rc = getrlimit(RLIMIT_NOFILE, &rl);
 	if (rc)
-		return false;
+		goto error3;
 
 	g_max_fd = rl.rlim_max;
 	g_fd_binding = (struct fd_binding *)calloc(rl.rlim_max, sizeof(struct fd_binding));
 	struct epoll_event ev;
 	ev.events = EPOLLIN;
 	ev.data.fd = g_x11_fd;
-	epoll_ctl(glplatform_epoll_fd, EPOLL_CTL_ADD, g_x11_fd, &ev); //TODO: check for errors
+	rc = epoll_ctl(glplatform_epoll_fd, EPOLL_CTL_ADD, g_x11_fd, &ev);
+	if (rc == -1)
+		goto error3;
 	g_screen = DefaultScreen(g_display);
 	g_delete_atom = XInternAtom(g_display, "WM_DELETE_WINDOW", True);
 	return true;
+error3:
+	XCloseDisplay(g_display);
+	g_display = NULL;
+error2:
+	close(glplatform_epoll_fd);
+	glplatform_epoll_fd = -1;
+error1:
+	pthread_key_delete(g_context_tls);
+	g_context_tls = 0;
+	return false;
 }
 
 void glplatform_shutdown()
 {
 	XCloseDisplay(g_display);
+	close(glplatform_epoll_fd);
+	pthread_key_delete(g_context_tls);
+	g_display = NULL;
+	g_context_tls = 0;
+	glplatform_epoll_fd = -1;
 }
 
 struct glplatform_win *glplatform_create_window(const char *title,
@@ -384,9 +418,19 @@ void glplatform_set_win_type(struct glplatform_win *win, enum glplatform_win_typ
 		1);
 }
 
-void glplatform_make_current(struct glplatform_win *win, glplatform_gl_context_t context)
+void glplatform_make_current(struct glplatform_win *win, glplatform_gl_context_t ctx)
+{
+	struct glplatform_context *context = (struct glplatform_context*)ctx;
+	pthread_setspecific(g_context_tls, context);
+	if (context)
+		glXMakeContextCurrent(g_display, win->glx_window, win->glx_window, context->ctx);
+	else
+		glXMakeContextCurrent(g_display, win->glx_window, win->glx_window, NULL);
+}
+
+struct glplatform_context *glplatform_get_context_priv()
 {
-	glXMakeContextCurrent(g_display, win->glx_window, win->glx_window, (void *)context);
+	return (struct glplatform_context *)pthread_getspecific(g_context_tls);
 }
 
 glplatform_gl_context_t glplatform_create_context(struct glplatform_win *win, int maj_ver, int min_ver)
@@ -397,7 +441,11 @@ glplatform_gl_context_t glplatform_create_context(struct glplatform_win *win, in
 		GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
 		0
 	};
-	return (glplatform_gl_context_t)glXCreateContextAttribsARB(g_display, win->fb_config, 0, 1, attribList);
+	GLXContext ctx = glXCreateContextAttribsARB(g_display, win->fb_config, 0, 1, attribList);
+	struct glplatform_context *context = calloc(1, sizeof(struct glplatform_context));
+	if (context)
+		context->ctx = ctx;
+	return (glplatform_gl_context_t)context;
 }
 
 void glplatform_fullscreen_win(struct glplatform_win *win, bool fullscreen)

+ 89 - 18
src/glplatform-win32.c

@@ -1,7 +1,5 @@
 #include "glplatform.h"
 
-#define GLPLATFORM_ENABLE_WGL_ARB_create_context
-#define GLPLATFORM_ENABLE_WGL_ARB_create_context_profile
 #include "glplatform-wgl.h"
 
 #include <wingdi.h>
@@ -17,11 +15,13 @@
 #undef wglCreateContext
 
 #include <windowsx.h>
+#include "glplatform_priv.h"
 
 static LRESULT CALLBACK PlatformWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
 
 static struct glplatform_win *g_win_list = NULL;
 static int g_glplatform_win_count = 0;
+static DWORD g_context_tls;
 
 static struct glplatform_win *find_glplatform_win(HWND hwnd)
 {
@@ -60,14 +60,36 @@ static void register_glplatform_win(struct glplatform_win *win)
 	g_win_list = win;
 }
 
-//TODO
-//bool glplatform_is_button_pressed(struct glplatform_win *win, int button)
+#define PRESSED_MASK ((SHORT)0x8000)
 
-//TODO
-//bool glplatform_is_shift_pressed(struct glplatform_win *win)
+bool glplatform_is_button_pressed(struct glplatform_win *win, int button)
+{
+	switch (button) {
+	case 0:
+		return GetKeyState(VK_LBUTTON) & PRESSED_MASK;
+	case 1:
+		return GetKeyState(VK_MBUTTON) & PRESSED_MASK;
+	case 2:
+		return GetKeyState(VK_RBUTTON) & PRESSED_MASK;
+	default:
+		return false;
+	}
+}
 
-//TODO
-//bool glplatform_is_control_pressed(struct glplatform_win *win)
+bool glplatform_is_shift_pressed(struct glplatform_win *win)
+{
+	return GetKeyState(VK_SHIFT) & PRESSED_MASK;
+}
+
+bool glplatform_is_control_pressed(struct glplatform_win *win)
+{
+	return GetKeyState(VK_CONTROL) & PRESSED_MASK;
+}
+
+struct glplatform_context *glplatform_get_context_priv()
+{
+	return (struct glplatform_context *)TlsGetValue(g_context_tls);
+}
 
 bool glplatform_init()
 {
@@ -82,17 +104,23 @@ bool glplatform_init()
 	wc.hIcon = NULL;
 	wc.hIconSm = NULL;
 	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
-	wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
+	wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
 	wc.lpszMenuName = NULL;
 
-	if (RegisterClassEx(&wc) == 0) {
+	if (RegisterClassEx(&wc) == 0)
 		return false;
-	}
+
+	g_context_tls = TlsAlloc();
+
+	if (g_context_tls == TLS_OUT_OF_INDEXES)
+		return false;
+
 	return true;
 }
 
 void glplatform_shutdown()
 {
+	TlsFree(g_context_tls);
 }
 
 static LRESULT CALLBACK windows_event(struct glplatform_win *win, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
@@ -124,6 +152,16 @@ static LRESULT CALLBACK windows_event(struct glplatform_win *win, HWND hWnd, UIN
 	GetClientRect(hWnd, &cr);
 
 	switch (Msg) {
+	case WM_SETCURSOR: {
+		WORD ht = LOWORD(lParam);
+		ShowCursor(TRUE);
+		if (ht == HTCLIENT) {
+			SetCursor(NULL);
+			return TRUE;
+		} else {
+			return DefWindowProc(hWnd, Msg, wParam, lParam);
+		}
+	} break;
 	case WM_PAINT: {
 		if (win->callbacks.on_expose)
 			win->callbacks.on_expose(win);
@@ -155,7 +193,6 @@ static LRESULT CALLBACK windows_event(struct glplatform_win *win, HWND hWnd, UIN
 		pfd.cStencilBits = win->fbformat.stencil_bits;
 		pfd.cAccumBits = win->fbformat.accum_bits;
 		pfd.cDepthBits = win->fbformat.depth_bits;
-
 		win->pixel_format = ChoosePixelFormat(win->hdc, &pfd);
 		if (win->pixel_format == 0) {
 			return -1;
@@ -253,7 +290,7 @@ struct glplatform_win *glplatform_create_window(const char *title,
 	struct glplatform_win *win = (struct glplatform_win *) malloc(sizeof(struct glplatform_win));
 	win->fbformat = *fbformat;
 	win->callbacks = *callbacks;
-
+	win->fullscreen = false;
 	RECT wr = { 0, 0, width, height };
 	AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
 
@@ -273,6 +310,7 @@ struct glplatform_win *glplatform_create_window(const char *title,
 		free(win);
 		return NULL;
 	}
+	win->hwnd = hwnd;
 	register_glplatform_win(win);
 	if (win->callbacks.on_create)
 		win->callbacks.on_create(win);
@@ -286,9 +324,16 @@ struct glplatform_win *glplatform_create_window(const char *title,
 //TODO
 //void glplatform_set_win_type(struct glplatform_win *win, enum glplatform_win_types type)
 
-void glplatform_make_current(struct glplatform_win *win, glplatform_gl_context_t context)
+
+void glplatform_make_current(struct glplatform_win *win, glplatform_gl_context_t ctx)
 {
-	wglMakeCurrent(win->hdc, (HGLRC)context);
+	struct glplatform_context *context = (struct glplatform_context*)ctx;
+
+	TlsSetValue(g_context_tls, context);
+	if (context)
+		wglMakeCurrent(win->hdc, context->rc);
+	else
+		wglMakeCurrent(win->hdc, 0);
 }
 
 glplatform_gl_context_t glplatform_create_context(struct glplatform_win *win, int maj_ver, int min_ver)
@@ -306,11 +351,37 @@ glplatform_gl_context_t glplatform_create_context(struct glplatform_win *win, in
 	};
 
 	HGLRC rc = wglCreateContextAttribsARB(win->hdc, 0, attribList);
-	return (glplatform_gl_context_t)rc;
+
+	if (!rc)
+		return 0;
+	struct glplatform_context *context = calloc(1, sizeof(struct glplatform_context));
+	if (context)
+		context->rc = rc;
+	return (glplatform_gl_context_t)context;
 }
 
-//TODO:
-//void glplatform_fullscreen_win(struct glplatform_win *win, bool fullscreen)
+void glplatform_fullscreen_win(struct glplatform_win *win, bool fullscreen)
+{
+	DWORD dwStyle = GetWindowLong(win->hwnd, GWL_STYLE);
+	if (fullscreen && !win->fullscreen) {
+		MONITORINFO mi = { sizeof(mi) };
+		GetWindowPlacement(win->hwnd, &win->prev_placement);
+		GetMonitorInfo(MonitorFromWindow(win->hwnd, MONITOR_DEFAULTTOPRIMARY), &mi);
+		SetWindowLong(win->hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
+		SetWindowPos(win->hwnd, HWND_TOP,
+			mi.rcMonitor.left, mi.rcMonitor.top,
+			mi.rcMonitor.right - mi.rcMonitor.left,
+			mi.rcMonitor.bottom - mi.rcMonitor.top,
+			SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
+	} else if (!fullscreen && win->fullscreen) {
+		SetWindowLong(win->hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW);
+		SetWindowPlacement(win->hwnd, &win->prev_placement);
+		SetWindowPos(win->hwnd, NULL, 0, 0, 0, 0,
+			SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
+			SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
+	}
+	win->fullscreen = fullscreen;
+}
 
 int glplatform_get_events(bool block)
 {

+ 2 - 0
src/glplatform.h

@@ -209,6 +209,7 @@ struct glplatform_win {
 	int pixel_format;
 	HDC hdc;
 	HWND hwnd;
+	WINDOWPLACEMENT prev_placement;
 #else
 	uint32_t window; //Window xid
 	void *fb_config; //GLXFBConfig
@@ -216,6 +217,7 @@ struct glplatform_win {
 	int x_state_mask;
 	uint32_t colormap; //Colormap
 #endif
+	bool fullscreen;
 	struct glplatform_fbformat fbformat;
 	struct glplatform_win_callbacks callbacks;
 	int width;

+ 0 - 0
src/glplatform_priv.h


Some files were not shown because too many files changed in this diff