• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Cross-Platform OpenGL Windowing Library


Commit MetaInfo

Revision8275f16707b290e85716c2a213b8fcd9dcbebdf7 (tree)
Zeit2019-06-03 14:31:20
AutorAlaskanEmily <emily@alas...>
CommiterAlaskanEmily

Log Message

Add Cygwin and Msys2 support

Ändern Zusammenfassung

Diff

--- a/gcc.mk
+++ b/gcc.mk
@@ -16,6 +16,9 @@ X11INCLUDE=-I/usr/X11R6/include
1616 glow_x11.o: glow_x11.c glow.h
1717 $(CC) $(CFLAGS) $(X11INCLUDE) -c glow_x11.c -o glow_x11.o
1818
19+glow_win32.o: glow_win32.c glow.h
20+ $(CC) $(CFLAGS) -DGLOW_DLL -D_WIN32 -DGLOW_EXPORTS -c glow_win32.c -o glow_win32.o
21+
1922 glow_x11.os: glow_x11.c glow.h
2023 $(CC) $(CFLAGS) $(FPICFLAGS) $(X11INCLUDE) -c glow_x11.c -o glow_x11.os
2124
--- a/glow_win32.c
+++ b/glow_win32.c
@@ -58,6 +58,16 @@ static HINSTANCE glow_app = NULL;
5858
5959 /******************************************************************************/
6060
61+#ifdef __CYGWIN__
62+
63+#ifndef SM_CXPADDEDBORDER
64+#define SM_CXPADDEDBORDER 92
65+#endif
66+
67+#endif
68+
69+/******************************************************************************/
70+
6171 static void glow_translate_local_mouse_pos(const POINT *in_pnt,
6272 struct Glow_Window *w, glow_pixel_coords_t out_pos){
6373 RECT rect;
@@ -220,6 +230,8 @@ BOOL WINAPI DllMain(HINSTANCE app, DWORD reason, LPVOID reserved){
220230 wc.hInstance = glow_app = app;
221231
222232 RegisterClass(&wc);
233+
234+ return TRUE;
223235 }
224236
225237 /******************************************************************************/
@@ -248,8 +260,6 @@ void Glow_ViewportSize(unsigned w, unsigned h,
248260 {
249261 const DWORD w_thickness = (size.right - w), h_thickness = (size.bottom - h);
250262
251- printf("w_thickness = %i, h_thickness = %i\n", w_thickness, h_thickness);
252-
253263 out_w[0] = w + w_thickness;
254264 out_h[0] = h + h_thickness;
255265 }
--- a/makefile
+++ b/makefile
@@ -11,10 +11,20 @@ glow_win32.obj: glow_win32.c glow.h
1111 glow.dll glow.lib:
1212 link /nologo /dll /out:glow.dll /implib:glow.lib OpenGL32.lib gdi32.lib user32.lib glow_win32.obj
1313
14-.else
14+.elif defined(OS) && (${OS} == "CYGWIN")
1515
16-all: libglow.so libglow.a
16+all: libglow.dll
1717
1818 .include "gcc.mk"
1919
20+libglow.dll: glow_win32.o
21+ $(CC) -shared -o libglow.dll glow_win32.o -lOpenGL32 -lGDI32
22+
23+.else
24+
25+all:
26+ echo ${OS}
27+
28+# .include "gcc.mk"
29+
2030 .endif