Selaa lähdekoodia

Make it compillable on 32-bit system

Pabloader 4 vuotta sitten
vanhempi
commit
a48abc49f9
3 muutettua tiedostoa jossa 30 lisäystä ja 9 poistoa
  1. 23
    1
      .vscode/c_cpp_properties.json
  2. 6
    6
      Makefile
  3. 1
    2
      src/main.cpp

+ 23
- 1
.vscode/c_cpp_properties.json Näytä tiedosto

@@ -13,7 +13,14 @@
13 13
             "compilerPath": "C:/MinGW/bin/gcc.exe",
14 14
             "cStandard": "c11",
15 15
             "cppStandard": "c++17",
16
-            "intelliSenseMode": "gcc-x64"
16
+            "intelliSenseMode": "gcc-x86",
17
+            "compilerArgs": [],
18
+            "browse": {
19
+                "path": [
20
+                    "${workspaceFolder}/**"
21
+                ],
22
+                "limitSymbolsToIncludedHeaders": true
23
+            }
17 24
         },
18 25
         {
19 26
             "name": "Linux",
@@ -25,6 +32,21 @@
25 32
             "cStandard": "c11",
26 33
             "cppStandard": "c++17",
27 34
             "intelliSenseMode": "gcc-x64"
35
+        },
36
+        {
37
+            "name": "Win32-Prestigio",
38
+            "includePath": [
39
+                "${workspaceFolder}/**"
40
+            ],
41
+            "defines": [
42
+                "_DEBUG",
43
+                "UNICODE",
44
+                "_UNICODE"
45
+            ],
46
+            "compilerPath": "D:/MinGW/mingw32/bin/gcc.exe",
47
+            "cStandard": "c11",
48
+            "cppStandard": "c++17",
49
+            "intelliSenseMode": "clang-x64"
28 50
         }
29 51
     ],
30 52
     "version": 4

+ 6
- 6
Makefile Näytä tiedosto

@@ -1,15 +1,15 @@
1
-# To compile this you will need MinGW64 with MSYS installed in PATH
1
+# To compile this you will need MinGW with MSYS installed in PATH
2 2
 
3
-CC=gcc
4
-CPP=g++
5
-CFLAGS=-m64 -Wall -Wno-misleading-indentation -Werror -g
6
-CPPFLAGS=-m64 -Wall -Wno-misleading-indentation -Werror --std=c++1z -g
7
-LDFLAGS=-m64 
3
+CFLAGS=-Wall -Wno-misleading-indentation -Werror -g
4
+CPPFLAGS=-Wall -Wno-misleading-indentation -Werror --std=c++1z -g
5
+LDFLAGS= 
8 6
 INCLUDES=-I./include
9 7
 ifeq ($(OS),Windows_NT)     # is Windows_NT on XP, 2000, 7, Vista, 10...
10 8
 	LIBRARIES=-luser32 -lgdi32 -lopengl32 -lgdiplus -lwinmm
11 9
 	EXECUTABLE=awoorwae.exe
12 10
 	LDFLAGS+=--machine=windows
11
+	CPP=i686-w64-mingw32-g++
12
+	CC=i686-w64-mingw32-gcc
13 13
 else
14 14
 	LIBRARIES=-lX11 -lGL -lpthread -lpng -lasound
15 15
 	EXECUTABLE=awoorwae

+ 1
- 2
src/main.cpp Näytä tiedosto

@@ -1,4 +1,3 @@
1
-#define OLC_PGE_APPLICATION
2 1
 #include "olcPixelGameEngine.h"
3 2
 #include "olcPGEX_Graphics2D.h"
4 3
 #include "olcPGEX_Sound.h"
@@ -32,7 +31,7 @@ public:
32 31
 int main()
33 32
 {
34 33
 	Example demo;
35
-	if (demo.Construct(256, 240, 1, 1))
34
+	if (demo.Construct(256, 240, 2, 1))
36 35
 		demo.Start();
37 36
 
38 37
 	return 0;

Loading…
Peruuta
Tallenna