Compare commits

..

1 Commits

  1. 28
      Makefile
  2. 2
      examples/Makefile
  3. 5
      include/GLDebug.h
  4. 1
      include/asset.h
  5. 1
      include/camera.h
  6. 1
      include/shader.h
  7. 12
      include/tangerine.h
  8. 1
      include/types.h
  9. 1
      src/asset.cpp
  10. 1
      src/camera.cpp
  11. 1
      src/entity.cpp
  12. 4
      src/shader.cpp
  13. 3
      src/tangerine.cpp

28
Makefile

@ -1,24 +1,20 @@
SHELL := /bin/sh SHELL = /bin/sh
CXX := g++ CXX = g++
# NOTE: have to set -O or -O1 here to get warnings for uninitialized variables CXXFLAGS = -std=c++11 -g -ggdb3 -Wall \
CXXFLAGS := -std=c++11 -g -ggdb3 -Wall -O -Wall -Wuninitialized \
-Iinclude \ -Iinclude \
-I/usr/include/SDL2 \ -I/usr/include/SDL2 \
-Iext/stb_libs \ -Iext/stb_libs \
-Iext/tinygltf -Iext/tinygltf
EXAMPLEDIR := examples EXAMPLEDIR = examples
OBJDIR := build OBJDIR = build
SRCDIR := src SRCDIR = src
LIBNAME := libTangerine.a LIBNAME = libTangerine.a
# NOTE: optional library settings SOURCES = $(wildcard $(SRCDIR)/*.cpp)
CXXFLAGS += -DTANGERINE_GL_DEBUG_QUIET OBJECTS = $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(SOURCES))
NDBG_SOURCES = $(wildcard $(SRCDIR)/*.cc)
SOURCES := $(wildcard $(SRCDIR)/*.cpp) NDBG_OBJS = $(patsubst $(SRCDIR)/%.cc, $(OBJDIR)/%.o, $(NDBG_SOURCES))
OBJECTS := $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(SOURCES))
NDBG_SOURCES := $(wildcard $(SRCDIR)/*.cc)
NDBG_OBJS := $(patsubst $(SRCDIR)/%.cc, $(OBJDIR)/%.o, $(NDBG_SOURCES))
all: mkdirs $(LIBNAME) all: mkdirs $(LIBNAME)

2
examples/Makefile

@ -34,7 +34,7 @@ BINDIR = bin
#.PHONY: clean #.PHONY: clean
all: mkdirs all: mkdirs
$(CXX) $(CXXFLAGS) main.cpp -o $(BINDIR)/testing $(LIB) $(LDFLAGS) $(CXX) $(CXXFLAGS) main.cpp -o $(BINDIR)/testing $(LDFLAGS) $(LIB)
mkdirs: mkdirs:
@mkdir -p $(BINDIR) $(OBJDIR) @mkdir -p $(BINDIR) $(OBJDIR)

5
include/GLDebug.h

@ -92,11 +92,6 @@ openglDebugCallback(GLenum source,
if (id == 131185) if (id == 131185)
return; return;
#ifdef TANGERINE_GL_DEBUG_QUIET
if (type != GL_DEBUG_TYPE_ERROR)
return;
#endif
std::cout << "message id: " << id << ", " std::cout << "message id: " << id << ", "
<< ((type == GL_DEBUG_TYPE_ERROR) ? "Error" : "Debug") << ((type == GL_DEBUG_TYPE_ERROR) ? "Error" : "Debug")
<< (type == GL_DEBUG_TYPE_ERROR ? "** GL Error **" : "") << (type == GL_DEBUG_TYPE_ERROR ? "** GL Error **" : "")

1
include/asset.h

@ -2,7 +2,6 @@
#pragma once #pragma once
#include <GL/glew.h> #include <GL/glew.h>
#define GLM_FORCE_XYZW_ONLY
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "types.h" #include "types.h"

1
include/camera.h

@ -1,7 +1,6 @@
#pragma once #pragma once
#define GLM_FORCE_XYZW_ONLY
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "types.h" #include "types.h"

1
include/shader.h

@ -3,7 +3,6 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <GL/glew.h> #include <GL/glew.h>
#define GLM_FORCE_XYZW_ONLY
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include "asset.h" #include "asset.h"

12
include/tangerine.h

@ -75,17 +75,11 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
// NOTE: optional compile-time defines:
// TANGERINE_GL_DEBUG_QUIET disable extra debug messages from openGL
#include "asset.h" #include "asset.h"
#include "camera.h" #include "camera.h"
#include "entity.h" #include "entity.h"
#include "dumbLog.h" #include "dumbLog.h"
#include "GLDebug.h" #include "GLDebug.h"
#include "input.h"
#include "shader.h" #include "shader.h"
#include "types.h" #include "types.h"
#include "util.h" #include "util.h"
@ -99,6 +93,9 @@ struct SDLHandles
u32 SDL_flags; u32 SDL_flags;
}; };
// TODO: node/tree structure for entities
struct Node;
struct RenderGroup struct RenderGroup
{ {
ShaderProgram* shader; ShaderProgram* shader;
@ -108,10 +105,7 @@ struct RenderGroup
char* name; char* name;
}; };
// TODO: node/tree structure for entities
#if 0 #if 0
struct Node;
struct Scene struct Scene
{ {
MemoryArena* rg_arena; MemoryArena* rg_arena;

1
include/types.h

@ -2,7 +2,6 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#define GLM_FORCE_XYZW_ONLY
#include <glm/glm.hpp> #include <glm/glm.hpp>

1
src/asset.cpp

@ -2,7 +2,6 @@
#include <cassert> #include <cassert>
#include <cstring> #include <cstring>
#define GLM_FORCE_XYZW_ONLY
#include <glm/ext/matrix_transform.hpp> #include <glm/ext/matrix_transform.hpp>
#include "tiny_gltf.h" #include "tiny_gltf.h"

1
src/camera.cpp

@ -2,7 +2,6 @@
#include <cassert> #include <cassert>
#include <GL/glew.h> #include <GL/glew.h>
#define GLM_FORCE_XYZW_ONLY
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>

1
src/entity.cpp

@ -1,5 +1,4 @@
#define GLM_FORCE_XYZW_ONLY
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include "dumbLog.h" #include "dumbLog.h"

4
src/shader.cpp

@ -6,12 +6,12 @@
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>
#define GLM_FORCE_XYZW_ONLY
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include "asset.h" #include "asset.h"
#include "dumbLog.h" #include "dumbLog.h"
#include "dummy_shader.h" #include "dummy_shader.h"
#define GL_DEBUG_IMPLEMENTATION
#include "GLDebug.h" #include "GLDebug.h"
#include "shader.h" #include "shader.h"
#include "util.h" #include "util.h"
@ -135,7 +135,7 @@ getFreeShader(GLContext* gl_ctx)
ShaderProgram* ShaderProgram*
getShaderByHash(GLContext* gl_ctx, u64 hash) getShaderByHash(GLContext* gl_ctx, u64 hash)
{ {
for (u32 i = 0; i < gl_ctx->num_shaders; i++) { for (u32 i; i < gl_ctx->num_shaders; i++) {
if (gl_ctx->shaders[i].hash == hash) if (gl_ctx->shaders[i].hash == hash)
return &gl_ctx->shaders[i]; return &gl_ctx->shaders[i];
} }

3
src/tangerine.cpp

@ -1,14 +1,11 @@
#include <cassert> #include <cassert>
#define GLM_FORCE_XYZW_ONLY
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include "tangerine.h" #include "tangerine.h"
#define UTIL_IMPLEMENTATION #define UTIL_IMPLEMENTATION
#include "util.h" #include "util.h"
#define GL_DEBUG_IMPLEMENTATION
#include "GLDebug.h"
// forward declarations // forward declarations

Loading…
Cancel
Save