-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
130 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,2 @@ | ||
CC=clang | ||
CXX=clang++ | ||
|
||
BUILDDIR = build | ||
|
||
SHELL = /bin/bash | ||
CFLAGS = -O0 -g | ||
|
||
INCLUDES = -I src \ | ||
-I third_party \ | ||
-I third_party/imgui \ | ||
# -I third_party/SDL2-2.0.3/include | ||
|
||
SHG_SOURCES = src/shadergen.cc | ||
MLT_SOURCES = src/milton_unity_build.cc | ||
|
||
SHG_CFLAGS = $(CFLAGS) \ | ||
-std=c++11 \ | ||
-Wno-writable-strings | ||
|
||
|
||
MLT_CFLAGS = $(CFLAGS) \ | ||
-std=c++11 \ | ||
`pkg-config --cflags sdl2 gtk+-2.0` \ | ||
-std=c++11 \ | ||
-Wno-missing-braces \ | ||
-Wno-unused-function \ | ||
-Wno-unused-variable \ | ||
-Wno-unused-result \ | ||
-Wno-write-strings \ | ||
-Wno-c++11-compat-deprecated-writable-strings \ | ||
-Wno-null-dereference \ | ||
-Wno-format \ | ||
-fno-strict-aliasing \ | ||
-fno-omit-frame-pointer \ | ||
-ldl \ | ||
-Werror | ||
|
||
# -fsanitize=address\ | ||
MLT_LDFLAGS = $(LDFLAGS) -lGL `pkg-config --libs sdl2 gtk+-2.0` -lXi | ||
|
||
all: directories shadergen milton | ||
|
||
shadergen: | ||
$(CC) $(SHG_CFLAGS) $(SHG_SOURCES) -o $(BUILDDIR)/shadergen | ||
|
||
milton: | ||
pushd $(BUILDDIR) && ./shadergen && popd | ||
$(CXX) $(MLT_CFLAGS) $(INCLUDES) $(MLT_SOURCES) $(MLT_LDFLAGS) -o $(BUILDDIR)/milton | ||
|
||
directories: | ||
@mkdir -p $(BUILDDIR) | ||
|
||
clean: | ||
rm -rf $(BUILDDIR) | ||
|
||
.PHONY: all clean directories | ||
all: | ||
tundra/bin/tundra2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
#pragma once | ||
|
||
#include "Stroke.h" | ||
#include "stroke.h" | ||
|
||
#include "memory.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
|
||
typedef int8_t i8; | ||
typedef int16_t i16; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
#ifdef __linux__ | ||
#ifndef _GNU_SOURCE | ||
#define _GNU_SOURCE // To get MAP_ANONYMOUS on linux | ||
#endif | ||
#include <gtk/gtk.h> | ||
#define __USE_MISC 1 // MAP_ANONYMOUS and MAP_NORESERVE dont' get defined without this | ||
#include <sys/mman.h> | ||
#undef __USE_MISC | ||
#include <unistd.h> | ||
|
||
#include <X11/Xlib.h> | ||
#include <X11/extensions/XInput.h> | ||
#if 0 | ||
#include <X11/extensions/XIproto.h> | ||
#include <X11/keysym.h> | ||
#endif | ||
// #define _GNU_SOURCE //temporarily targeting gcc for program_invocation_name | ||
#include <sys/stat.h> | ||
#include <sys/time.h> | ||
#include <errno.h> | ||
#include <time.h> | ||
#include <ctype.h> | ||
|
||
#define BREAKHERE raise(SIGTRAP) | ||
|
||
#elif defined(__MACH__) | ||
#include <sys/mman.h> | ||
#include <unistd.h> // getpid | ||
#else | ||
#error "This is not the Unix you're looking for" | ||
#endif | ||
|
||
#ifndef MAP_ANONYMOUS | ||
|
||
#ifndef MAP_ANON | ||
#error "MAP_ANONYMOUS flag not found!" | ||
#else | ||
#define MAP_ANONYMOUS MAP_ANON | ||
#endif | ||
|
||
#endif // MAP_ANONYMOUS | ||
|
||
|
||
#define PATH_STRLEN strlen | ||
#define PATH_TOLOWER tolower | ||
#define PATH_STRCMP strcmp | ||
#define PATH_STRNCPY strncpy | ||
#define PATH_STRCPY strcpy | ||
//#define PATH_STRCAT strcat | ||
#define PATH_STRNCAT strncat | ||
#define PATH_SNPRINTF snprintf | ||
#define platform_milton_log printf | ||
|
||
#if defined(__MACH__) | ||
// Include header for our SDL hook. | ||
#include "platform_OSX_SDL_hooks.h" | ||
#endif | ||
|
||
FILE* fopen_unix(const char* fname, const char* mode); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.