Browse Source

First commit

Pabloader 4 years ago
commit
87c3a752b7
4 changed files with 2387 additions and 0 deletions
  1. 31
    0
      Makefile
  2. 2
    0
      src/.gitignore
  3. 37
    0
      src/main.cpp
  4. 2317
    0
      src/olcPixelGameEngine.h

+ 31
- 0
Makefile View File

@@ -0,0 +1,31 @@
1
+CC=gcc
2
+CPP=g++
3
+CFLAGS=-Wall -Wno-misleading-indentation -Werror -g
4
+CPPFLAGS=-Wall -Wno-misleading-indentation -Werror --std=c++1z -g 
5
+LDFLAGS=
6
+INCLUDES=
7
+LIBRARIES=-lX11 -lGL -lpthread -lpng
8
+SOURCES=$(wildcard src/*.c)
9
+SOURCES_CPP=$(wildcard src/*.cpp)
10
+OBJECTS=$(SOURCES:.c=.o) $(SOURCES_CPP:.cpp=.o)
11
+EXECUTABLE=awoorwa
12
+
13
+all: $(SOURCES) $(SOURCES_CPP) $(EXECUTABLE)
14
+
15
+clean: 
16
+	rm -rf $(OBJECTS) $(EXECUTABLE)
17
+	
18
+$(EXECUTABLE): $(OBJECTS) 
19
+	$(CPP) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBRARIES)
20
+
21
+.c.o:
22
+	$(CC) $(INCLUDES) -c $(CFLAGS) $< -o $@
23
+
24
+.cpp.o:
25
+	$(CPP) $(INCLUDES) -c $(CPPFLAGS) $< -o $@
26
+
27
+debug: $(EXECUTABLE)
28
+	gdb $(EXECUTABLE)
29
+
30
+run: $(EXECUTABLE)
31
+	./$(EXECUTABLE)

+ 2
- 0
src/.gitignore View File

@@ -0,0 +1,2 @@
1
+awoorwa
2
+*.o

+ 37
- 0
src/main.cpp View File

@@ -0,0 +1,37 @@
1
+#define OLC_PGE_APPLICATION
2
+#include "olcPixelGameEngine.h"
3
+
4
+class Example : public olc::PixelGameEngine
5
+{
6
+public:
7
+	Example()
8
+	{
9
+		sAppName = "Awoorwa";
10
+	}
11
+
12
+public:
13
+	bool OnUserCreate() override
14
+	{
15
+		// Called once at the start, so create things here
16
+		return true;
17
+	}
18
+
19
+	bool OnUserUpdate(float fElapsedTime) override
20
+	{
21
+		// called once per frame
22
+		for (int x = 0; x < ScreenWidth(); x++)
23
+			for (int y = 0; y < ScreenHeight(); y++)
24
+				Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255));	
25
+		return true;
26
+	}
27
+};
28
+
29
+
30
+int main()
31
+{
32
+	Example demo;
33
+	if (demo.Construct(256, 240, 1, 1))
34
+		demo.Start();
35
+
36
+	return 0;
37
+}

+ 2317
- 0
src/olcPixelGameEngine.h
File diff suppressed because it is too large
View File


Loading…
Cancel
Save