Skip to content

Commit

Permalink
Reorganized project layout. Moved includes into include/ and source f…
Browse files Browse the repository at this point in the history
…iles into src/. Renamed some source files. Updated CMakeLists and Android.mk.
  • Loading branch information
grimfang4 committed Feb 11, 2015
1 parent 15a1aba commit 748ea7e
Show file tree
Hide file tree
Showing 34 changed files with 61 additions and 69 deletions.
14 changes: 7 additions & 7 deletions SDL_gpu/Android.mk → Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ include $(CLEAR_VARS)
LOCAL_MODULE := SDL2_gpu

SDL_GPU_DIR := ./
STB_IMAGE_DIR := $(SDL_GPU_DIR)/externals/stb_image
STB_IMAGE_DIR := $(SDL_GPU_DIR)/src/externals/stb_image

LOCAL_CFLAGS := -I$(LOCAL_PATH)/../SDL/include -I$(LOCAL_PATH)/$(SDL_GPU_DIR) -I$(LOCAL_PATH)/$(RENDERER_DIR) -I$(LOCAL_PATH)/$(STB_IMAGE_DIR)
LOCAL_CFLAGS := -I$(LOCAL_PATH)/../SDL/include -I$(LOCAL_PATH)/$(SDL_GPU_DIR)/include -I$(LOCAL_PATH)/$(STB_IMAGE_DIR)

LOCAL_SRC_FILES := $(SDL_GPU_DIR)/SDL_gpu.c \
$(SDL_GPU_DIR)/SDL_gpu_Renderer.c \
$(SDL_GPU_DIR)/SDL_gpuShapes.c \
$(SDL_GPU_DIR)/GL_common/SDL_gpu_GL_matrix.c \
$(SDL_GPU_DIR)/GLES_1/SDL_gpu_GLES_1.c \
$(SDL_GPU_DIR)/GLES_2/SDL_gpu_GLES_2.c \
$(SDL_GPU_DIR)/SDL_gpu_matrix.c \
$(SDL_GPU_DIR)/SDL_gpu_renderer.c \
$(SDL_GPU_DIR)/SDL_gpu_shapes.c \
$(SDL_GPU_DIR)/renderer_GLES_1.c \
$(SDL_GPU_DIR)/renderer_GLES_2.c \
$(STB_IMAGE_DIR)/stb_image.c \
$(STB_IMAGE_DIR)/stb_image_write.c

Expand Down
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ option(SDL_gpu_DISABLE_GLES_1 "Disable OpenGLES 1.X renderer" OFF)
option(SDL_gpu_DISABLE_GLES_2 "Disable OpenGLES 2.X renderer" OFF)
option(SDL_gpu_DISABLE_GLES_3 "Disable OpenGLES 3.X renderer" OFF)

set(SDL_gpu_VERSION 0.9.0)
set(SDL_gpu_VERSION 0.10.0)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/scripts)

Expand Down Expand Up @@ -150,29 +150,23 @@ if(NOT WIN32)
endif (NOT WIN32)

# Make local includes look in the right places
include_directories(SDL_gpu)
include_directories(SDL_gpu/GL_common)
include_directories(SDL_gpu/OpenGL_1_BASE)
include_directories(SDL_gpu/OpenGL_1)
include_directories(SDL_gpu/OpenGL_2)
include_directories(SDL_gpu/OpenGL_3)
include_directories(SDL_gpu/GLES_1)
include_directories(SDL_gpu/GLES_2)
include_directories(include)
include_directories(src)

if(NOT GLEW_FOUND)
include_directories(SDL_gpu/externals/glew)
include_directories(src/externals/glew)
endif(NOT GLEW_FOUND)

if(NOT STBI_FOUND)
include_directories(SDL_gpu/externals/stb_image)
include_directories(src/externals/stb_image)
add_definitions("-DSTBI_FAILURE_USERMSG")
endif(NOT STBI_FOUND)


add_definitions("-Wall -std=c99 -pedantic")

# Build the SDL_gpu library.
add_subdirectory(SDL_gpu)
add_subdirectory(src)

# Build the demos
if(SDL_gpu_BUILD_DEMOS)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.

INPUT = SDL_gpu
INPUT = include src

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
Expand Down
3 changes: 0 additions & 3 deletions SDL_gpu/SDL_gpuConfig.cmake

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
63 changes: 29 additions & 34 deletions SDL_gpu/CMakeLists.txt → src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
set(SDL_gpu_SRCS
${SDL_gpu_SRCS}
SDL_gpu.c
SDL_gpuShapes.c
SDL_gpu_Renderer.c
SDL_gpu_matrix.c
OpenGL_1_BASE/SDL_gpu_OpenGL_1_BASE.c
OpenGL_1/SDL_gpu_OpenGL_1.c
OpenGL_2/SDL_gpu_OpenGL_2.c
OpenGL_3/SDL_gpu_OpenGL_3.c
GLES_1/SDL_gpu_GLES_1.c
GLES_2/SDL_gpu_GLES_2.c
SDL_gpu_renderer.c
SDL_gpu_shapes.c
renderer_OpenGL_1_BASE.c
renderer_OpenGL_1.c
renderer_OpenGL_2.c
renderer_OpenGL_3.c
renderer_GLES_1.c
renderer_GLES_2.c
)

set(SDL_gpu_HDRS
${SDL_gpu_HDRS}
SDL_gpu.h
SDL_gpu_RendererImpl.h
GL_common/SDL_gpu_GL_common.inl
GL_common/SDL_gpuShapes_GL_common.inl
OpenGL_1_BASE/SDL_gpu_OpenGL_1_BASE.h
OpenGL_1/SDL_gpu_OpenGL_1.h
OpenGL_2/SDL_gpu_OpenGL_2.h
OpenGL_3/SDL_gpu_OpenGL_3.h
GLES_1/SDL_gpu_GLES_1.h
GLES_2/SDL_gpu_GLES_2.h
../include/SDL_gpu.h
../include/SDL_gpu_RendererImpl.h
../include/SDL_gpu_OpenGL_1_BASE.h
../include/SDL_gpu_OpenGL_1.h
../include/SDL_gpu_OpenGL_2.h
../include/SDL_gpu_OpenGL_3.h
../include/SDL_gpu_GLES_1.h
../include/SDL_gpu_GLES_2.h
renderer_GL_common.inl
renderer_shapes_GL_common.inl
)

if(STBI_FOUND)
Expand All @@ -44,17 +44,17 @@ endif(STBI_WRITE_FOUND)


set(SDL_gpu_install_HDRS
SDL_gpu.h
SDL_gpu_RendererImpl.h
OpenGL_1_BASE/SDL_gpu_OpenGL_1_BASE.h
OpenGL_1/SDL_gpu_OpenGL_1.h
OpenGL_2/SDL_gpu_OpenGL_2.h
OpenGL_3/SDL_gpu_OpenGL_3.h
GLES_1/SDL_gpu_GLES_1.h
GLES_2/SDL_gpu_GLES_2.h
../include/SDL_gpu.h
../include/SDL_gpu_RendererImpl.h
../include/SDL_gpu_OpenGL_1_BASE.h
../include/SDL_gpu_OpenGL_1.h
../include/SDL_gpu_OpenGL_2.h
../include/SDL_gpu_OpenGL_3.h
../include/SDL_gpu_GLES_1.h
../include/SDL_gpu_GLES_2.h
)

# Set the appropriate library name so SDL_gpu and SDL2_gpu can co-exist.
# Set the appropriate library name for the version of SDL used
if ( SDL_gpu_USE_SDL1)
set (SDL_gpu_OUTPUT_NAME "SDL_gpu")
else ( SDL_gpu_USE_SDL1)
Expand All @@ -75,7 +75,7 @@ if(SDL_gpu_BUILD_SHARED)
set_target_properties(SDL_gpu_shared PROPERTIES LINKER_LANGUAGE C)
endif()

# Build the static library (.a)
# Build the static library (.a or .lib)
if(SDL_gpu_BUILD_STATIC)
add_library(SDL_gpu STATIC
${SDL_gpu_HDRS}
Expand All @@ -92,20 +92,15 @@ endif()
# These are used to create visual studio folders.
source_group(Common FILES ${SDL_gpu_SRCS} ${SDL_gpu_HDRS})

# Install the library
# Install the headers and library
if(SDL_gpu_INSTALL)
# install headers
install(FILES ${SDL_gpu_install_HDRS} DESTINATION include/SDL)

# install libraries
if(SDL_gpu_BUILD_SHARED)
install(TARGETS SDL_gpu_shared EXPORT SDL_gpu-targets DESTINATION lib)
endif()
if(SDL_gpu_BUILD_STATIC)
install(TARGETS SDL_gpu EXPORT SDL_gpu-targets DESTINATION lib)
endif()

# install build system hooks for third-party apps
#install(EXPORT SDL_gpu-targets DESTINATION ./SDL_gpu)
#install(FILES SDL_gpuConfig.cmake DESTINATION ./SDL_gpu)
endif(SDL_gpu_INSTALL)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions SDL_gpu/GLES_1/SDL_gpu_GLES_1.c → src/renderer_GLES_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ void GPU_FreeRenderer_GLES_1(GPU_Renderer* renderer) {}
#define SDL_GPU_DISABLE_SHADERS
#define SDL_GPU_APPLY_TRANSFORMS_TO_GL_STACK
#define SDL_GPU_NO_VAO
#include "../GL_common/SDL_gpu_GL_common.inl"
#include "../GL_common/SDL_gpuShapes_GL_common.inl"

#include "renderer_GL_common.inl"
#include "renderer_shapes_GL_common.inl"


GPU_Renderer* GPU_CreateRenderer_GLES_1(GPU_RendererID request)
Expand Down
5 changes: 3 additions & 2 deletions SDL_gpu/GLES_2/SDL_gpu_GLES_2.c → src/renderer_GLES_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ void GPU_FreeRenderer_GLES_2(GPU_Renderer* renderer) {}
#define SDL_GPU_GLSL_VERSION 100
#define SDL_GPU_GLES_MAJOR_VERSION 2
#define SDL_GPU_NO_VAO
#include "../GL_common/SDL_gpu_GL_common.inl"
#include "../GL_common/SDL_gpuShapes_GL_common.inl"

#include "renderer_GL_common.inl"
#include "renderer_shapes_GL_common.inl"


GPU_Renderer* GPU_CreateRenderer_GLES_2(GPU_RendererID request)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ void GPU_FreeRenderer_OpenGL_1(GPU_Renderer* renderer) {}
#define SDL_GPU_GL_MAJOR_VERSION 1
#define SDL_GPU_APPLY_TRANSFORMS_TO_GL_STACK
#define SDL_GPU_NO_VAO
#include "../GL_common/SDL_gpu_GL_common.inl"
#include "../GL_common/SDL_gpuShapes_GL_common.inl"

#include "renderer_GL_common.inl"
#include "renderer_shapes_GL_common.inl"


GPU_Renderer* GPU_CreateRenderer_OpenGL_1(GPU_RendererID request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ void GPU_FreeRenderer_OpenGL_1_BASE(GPU_Renderer* renderer) {}
#define SDL_GPU_GL_MAJOR_VERSION 1
#define SDL_GPU_APPLY_TRANSFORMS_TO_GL_STACK
#define SDL_GPU_NO_VAO
#include "../GL_common/SDL_gpu_GL_common.inl"
#include "../GL_common/SDL_gpuShapes_GL_common.inl"

#include "renderer_GL_common.inl"
#include "renderer_shapes_GL_common.inl"


GPU_Renderer* GPU_CreateRenderer_OpenGL_1_BASE(GPU_RendererID request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ void GPU_FreeRenderer_OpenGL_2(GPU_Renderer* renderer) {}
#define SDL_GPU_GLSL_VERSION 120
#define SDL_GPU_GL_MAJOR_VERSION 2
#define SDL_GPU_NO_VAO
#include "../GL_common/SDL_gpu_GL_common.inl"
#include "../GL_common/SDL_gpuShapes_GL_common.inl"

#include "renderer_GL_common.inl"
#include "renderer_shapes_GL_common.inl"


GPU_Renderer* GPU_CreateRenderer_OpenGL_2(GPU_RendererID request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ void GPU_FreeRenderer_OpenGL_3(GPU_Renderer* renderer) {}
#define SDL_GPU_GL_TIER 3
#define SDL_GPU_GLSL_VERSION 130
#define SDL_GPU_GL_MAJOR_VERSION 3
#include "../GL_common/SDL_gpu_GL_common.inl"
#include "../GL_common/SDL_gpuShapes_GL_common.inl"

#include "renderer_GL_common.inl"
#include "renderer_shapes_GL_common.inl"


GPU_Renderer* GPU_CreateRenderer_OpenGL_3(GPU_RendererID request)
Expand Down
File renamed without changes.

0 comments on commit 748ea7e

Please sign in to comment.