Browse Source

Make it compillable on 32-bit system

Pabloader 5 years ago
parent
commit
a48abc49f9
3 changed files with 30 additions and 9 deletions
  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 View File

13
             "compilerPath": "C:/MinGW/bin/gcc.exe",
13
             "compilerPath": "C:/MinGW/bin/gcc.exe",
14
             "cStandard": "c11",
14
             "cStandard": "c11",
15
             "cppStandard": "c++17",
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
             "name": "Linux",
26
             "name": "Linux",
25
             "cStandard": "c11",
32
             "cStandard": "c11",
26
             "cppStandard": "c++17",
33
             "cppStandard": "c++17",
27
             "intelliSenseMode": "gcc-x64"
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
     "version": 4
52
     "version": 4

+ 6
- 6
Makefile View File

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
 INCLUDES=-I./include
6
 INCLUDES=-I./include
9
 ifeq ($(OS),Windows_NT)     # is Windows_NT on XP, 2000, 7, Vista, 10...
7
 ifeq ($(OS),Windows_NT)     # is Windows_NT on XP, 2000, 7, Vista, 10...
10
 	LIBRARIES=-luser32 -lgdi32 -lopengl32 -lgdiplus -lwinmm
8
 	LIBRARIES=-luser32 -lgdi32 -lopengl32 -lgdiplus -lwinmm
11
 	EXECUTABLE=awoorwae.exe
9
 	EXECUTABLE=awoorwae.exe
12
 	LDFLAGS+=--machine=windows
10
 	LDFLAGS+=--machine=windows
11
+	CPP=i686-w64-mingw32-g++
12
+	CC=i686-w64-mingw32-gcc
13
 else
13
 else
14
 	LIBRARIES=-lX11 -lGL -lpthread -lpng -lasound
14
 	LIBRARIES=-lX11 -lGL -lpthread -lpng -lasound
15
 	EXECUTABLE=awoorwae
15
 	EXECUTABLE=awoorwae

+ 1
- 2
src/main.cpp View File

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

Loading…
Cancel
Save