Fix makefile not defining DUNICODE on windows for mingw

This fixes 'error setting current directory' and other functions.
This commit is contained in:
UnknownShadow200 2019-07-17 21:05:57 +10:00
parent 8b6b262d7a
commit 6de770c6a4
3 changed files with 14 additions and 1 deletions

View file

@ -25,7 +25,7 @@ endif
ifeq ($(PLAT),mingw)
OEXT=.exe
CFLAGS=-w -g -pipe
CFLAGS=-w -g -pipe -DUNICODE
LDFLAGS=-g
LIBS=-mwindows -lws2_32 -lwininet -lwinmm -limagehlp -lcrypt32 -ld3d9
endif

View file

@ -7,6 +7,7 @@
#include "ExtMath.h"
int Display_BitsPerPixel;
int Display_DpiX = 96, Display_DpiY = 96;
Rect2D Display_Bounds;
int Window_X, Window_Y, Window_Width, Window_Height;
bool Window_Exists, Window_Focused;
@ -350,7 +351,10 @@ void Window_Init(void) {
Display_Bounds.Width = GetSystemMetrics(SM_CXSCREEN);
Display_Bounds.Height = GetSystemMetrics(SM_CYSCREEN);
Display_BitsPerPixel = GetDeviceCaps(hdc, BITSPIXEL);
Display_DpiX = GetDeviceCaps(hdc, LOGPIXELSX);
Display_DpiY = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(NULL, hdc);
Platform_Log2("DPI: %i, %i", &Display_DpiX, &Display_DpiY);
}
void Window_Create(int x, int y, int width, int height, struct GraphicsMode* mode) {

View file

@ -33,7 +33,16 @@
/* The states the window can be in. */
enum WindowState { WINDOW_STATE_NORMAL, WINDOW_STATE_MINIMISED, WINDOW_STATE_MAXIMISED, WINDOW_STATE_FULLSCREEN };
/* Number of bits per pixel. (red bits + green bits + blue bits + alpha bits) */
/* NOTE: Only 24 or 32 bits per pixel are officially supported. */
/* Support for other values of bits per pixel is platform dependent. */
extern int Display_BitsPerPixel;
/* Number of physical dots per inch of the display both horizontally and vertically. */
/* NOTE: Usually 96 for compatibility, even if the display's DPI is higher. */
/* GUI elements must be scaled by this to look correct. */
extern int Display_DpiX, Display_DpiY;
/* Position and size of this display. */
/* NOTE: Position may be non-zero in a multi-monitor setup. Platform dependent. */
extern Rect2D Display_Bounds;
struct GraphicsMode { int R, G, B, A, IsIndexed; };