diff EXCLUDE/GLTSF/src/Window.cpp @ 4734:0c7c67d4e6ee

Added On_Char method to Window_Listener for WM_CHAR messages. Removed a lot of TSF code because part of it was wrong and part was too complicated. Added Clear method to clear the window. IME input should work in both windowed mode and fullscreen mode with these changes. I have tested on Windows XP SP3 and Windows 7 Ultimate in VirtualBox. When you type a character (with an IME or not), the console will show the code point as U+XXXX. You use Left Alt+Shift (or whatever you have it set to) to switch input languages as usual. Hit ESC to exit (or close the window in windowed mode). The program will pause before exiting so you can review the console output (press a key to exit).
author dewyatt
date Wed, 09 Jun 2010 00:03:54 -0400
parents 6032ada8b9e5
children 0e18c79c4111
line wrap: on
line diff
--- a/EXCLUDE/GLTSF/src/Window.cpp	Tue Jun 08 05:22:49 2010 -0400
+++ b/EXCLUDE/GLTSF/src/Window.cpp	Wed Jun 09 00:03:54 2010 -0400
@@ -1,4 +1,5 @@
 #include "Window.hpp"
+#include <gl/GL.h>
 
 #pragma comment(lib, "opengl32.lib")
 
@@ -83,7 +84,7 @@
 	int Height = my_Video_Mode.Height;
 	ReleaseDC(NULL, Screen_DC);
 
-	DWORD Style = WS_OVERLAPPEDWINDOW;
+	DWORD Style = WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU;
 	if (!my_Fullscreen)
 	{
 		RECT Rect = {0, 0, Width, Height};
@@ -227,6 +228,9 @@
 	case WM_KEYUP:
 		Call_Listener(On_Key_Up(wParam));
 		break;
+	case WM_CHAR:
+		Call_Listener(On_Char(wParam));
+		break;
 	default:
 		return DefWindowProcW(Handle, Message, wParam, lParam);
 		break;
@@ -261,3 +265,8 @@
 	if (my_Device_Context && my_GL_Context)
 		SwapBuffers(my_Device_Context);
 }
+
+void Window::Clear()
+{
+	glClear(GL_COLOR_BUFFER_BIT);
+}