Browse Source

win32 ansi functions

Henrique Santiago 10 years ago
parent
commit
dab9faab91
1 changed files with 17 additions and 21 deletions
  1. 17
    21
      src/framework/win32platform.cpp

+ 17
- 21
src/framework/win32platform.cpp View File

@@ -44,7 +44,7 @@ void Platform::init()
44 44
 {
45 45
     win32.instance = GetModuleHandle(NULL);
46 46
 
47
-    WNDCLASS wc;
47
+    WNDCLASSA wc;
48 48
     wc.style			= CS_HREDRAW | CS_VREDRAW | CS_OWNDC;	// Redraw On Size, And Own DC For Window.
49 49
     wc.lpfnWndProc		= (WNDPROC)WndProc;			// WndProc Handles Messages
50 50
     wc.cbClsExtra		= 0;					// No Extra Window Data
@@ -54,9 +54,9 @@ void Platform::init()
54 54
     wc.hCursor			= LoadCursor(NULL, IDC_ARROW);		// Load The Arrow Pointer
55 55
     wc.hbrBackground            = NULL;					// No Background Required For GL
56 56
     wc.lpszMenuName		= NULL;					// We Don't Want A Menu
57
-    wc.lpszClassName            = L"OTClient";		// Set The Class Name
57
+    wc.lpszClassName            = "OTClient";		// Set The Class Name
58 58
 
59
-    if(!RegisterClass(&wc))
59
+    if(!RegisterClassA(&wc))
60 60
         fatal("Failed to register the window class.");
61 61
 }
62 62
 
@@ -68,7 +68,7 @@ void Platform::terminate()
68 68
     }
69 69
 
70 70
     if(win32.instance) {
71
-        if(!UnregisterClass(L"OTClient", win32.instance))
71
+        if(!UnregisterClassA("OTClient", win32.instance))
72 72
             error("Unregister class failed.");
73 73
 
74 74
         win32.instance = NULL;
@@ -109,18 +109,18 @@ bool Platform::createWindow(int x, int y, int width, int height, int minWidth, i
109 109
 
110 110
     //AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle);
111 111
 
112
-    win32.window = CreateWindowEx(dwExStyle,		// Extended Style For The Window
113
-                                  L"OTClient",		// Class Name
114
-                                  L"OTClient",          // Window Title
115
-                                  dwStyle,		// Required Window Style
116
-                                  x,                    // Window X Position
117
-                                  y,                    // Window Y Position
118
-                                  width,                // Calculate Window Width
119
-                                  height,               // Calculate Window Height
120
-                                  NULL,			// No Parent Window
121
-                                  NULL,			// No Menu
122
-                                  win32.instance,	// Instance
123
-                                  NULL);
112
+    win32.window = CreateWindowExA(dwExStyle,		// Extended Style For The Window
113
+                                   "OTClient",		// Class Name
114
+                                   "OTClient",          // Window Title
115
+                                   dwStyle,		// Required Window Style
116
+                                   x,                    // Window X Position
117
+                                   y,                    // Window Y Position
118
+                                   width,                // Calculate Window Width
119
+                                   height,               // Calculate Window Height
120
+                                   NULL,			// No Parent Window
121
+                                   NULL,			// No Menu
122
+                                   win32.instance,	// Instance
123
+                                   NULL);
124 124
 
125 125
     if(!win32.window) {
126 126
         terminate();
@@ -221,8 +221,7 @@ void Platform::showWindow()
221 221
 
222 222
 void Platform::setWindowTitle(const char *title)
223 223
 {
224
-    // TODO
225
-    SetWindowText(win32.window, (LPCWSTR)title);
224
+    SetWindowTextA(win32.window, title);
226 225
 }
227 226
 
228 227
 void *Platform::getExtensionProcAddress(const char *ext)
@@ -232,7 +231,6 @@ void *Platform::getExtensionProcAddress(const char *ext)
232 231
 
233 232
 bool Platform::isExtensionSupported(const char *ext)
234 233
 {
235
-    // TODO
236 234
     const char *exts = NULL;//glXQueryExtensionsString(x11.display, DefaultScreen(x11.display));
237 235
     if(strstr(exts, ext))
238 236
         return true;
@@ -241,7 +239,6 @@ bool Platform::isExtensionSupported(const char *ext)
241 239
 
242 240
 void Platform::showMouseCursor()
243 241
 {
244
-    // TODO
245 242
     ShowCursor(false);
246 243
     /*XUndefineCursor(x11.display, x11.window);
247 244
     if(x11.cursor != None) {
@@ -281,7 +278,6 @@ int Platform::getWindowHeight()
281 278
 
282 279
 const char *Platform::getAppUserDir()
283 280
 {
284
-    // TODO
285 281
     /*std::stringstream sdir;
286 282
     sdir << PHYSFS_getUserDir() << "/." << APP_NAME << "/";
287 283
     if((mkdir(sdir.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) && (errno != EEXIST))

Loading…
Cancel
Save