Get all samples compiling
This commit is contained in:
parent
84b1f40cf8
commit
120242b5f9
|
@ -54,21 +54,21 @@ include_directories(include)
|
|||
|
||||
link_libraries(GLdc)
|
||||
|
||||
function(gen_sample sample sources)
|
||||
function(gen_sample sample)
|
||||
set(SAMPLE_SRCS ${ARGN})
|
||||
set(GENROMFS "$ENV{KOS_BASE}/utils/genromfs/genromfs")
|
||||
set(BIN2O $ENV{KOS_BASE}/utils/bin2o/bin2o)
|
||||
set(ROMDISK_IMG "${CMAKE_SOURCE_DIR}/samples/${sample}/romdisk.img")
|
||||
set(ROMDISK_O "${CMAKE_SOURCE_DIR}/samples/${sample}/romdisk.o")
|
||||
set(ROMDISK_DIR "${CMAKE_SOURCE_DIR}/samples/${sample}/romdisk")
|
||||
|
||||
add_executable(${sample} ${sources})
|
||||
add_executable(${sample} ${SAMPLE_SRCS})
|
||||
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/samples/${sample}/romdisk")
|
||||
message("Generating romdisk for sample: ${sample}")
|
||||
add_custom_command(
|
||||
OUTPUT ${ROMDISK_IMG}
|
||||
COMMAND ${GENROMFS} -f ${ROMDISK_IMG} -d ${ROMDISK_DIR} -v
|
||||
DEPENDS ${sample}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
|
@ -78,30 +78,43 @@ function(gen_sample sample sources)
|
|||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/samples/${sample}"
|
||||
)
|
||||
|
||||
add_custom_target(run_${sample} ALL DEPENDS ${ROMDISK_O})
|
||||
add_custom_target(${sample}_romdisk DEPENDS ${ROMDISK_O})
|
||||
add_dependencies(${sample} ${sample}_romdisk)
|
||||
target_link_libraries(${sample} ${ROMDISK_O})
|
||||
|
||||
else()
|
||||
message("No such romdisk for sample: ${sample} at 'samples/${sample}/romdisk'")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
gen_sample(nehe02 samples/nehe02/main.c)
|
||||
gen_sample(blend_test samples/blend_test/main.c)
|
||||
gen_sample(depth_funcs samples/depth_funcs/main.c)
|
||||
gen_sample(depth_funcs_alpha_testing samples/depth_funcs_alpha_testing/main.c samples/depth_funcs_alpha_testing/gl_png.c)
|
||||
gen_sample(depth_funcs_ortho samples/depth_funcs_ortho/main.c)
|
||||
gen_sample(lerabot01 samples/lerabot01/main.c)
|
||||
gen_sample(lerabot_blend_test samples/lerabot_blend_test/main.c)
|
||||
gen_sample(lights samples/lights/main.c)
|
||||
gen_sample(mipmap samples/mipmap/main.c)
|
||||
gen_sample(multitexture_arrays samples/multitexture_arrays/main.c samples/multitexture_arrays/pvr-texture.c)
|
||||
gen_sample(nehe02 samples/nehe02/main.c)
|
||||
gen_sample(nehe02de samples/nehe02de/main.c)
|
||||
gen_sample(nehe02va samples/nehe02va/main.c)
|
||||
gen_sample(nehe03 samples/nehe03/main.c)
|
||||
gen_sample(nehe04 samples/nehe04/main.c)
|
||||
gen_sample(nehe05 samples/nehe05/main.c)
|
||||
gen_sample(nehe06 samples/nehe06/main.c)
|
||||
gen_sample(nehe06_vq samples/nehe06_vq/main.c)
|
||||
gen_sample(ortho2d samples/ortho2d/main.c)
|
||||
gen_sample(paletted samples/paletted/main.c)
|
||||
gen_sample(paletted_pcx samples/paletted_pcx/main.c)
|
||||
gen_sample(polygon_offset samples/polygon_offset/main.c)
|
||||
gen_sample(terrain samples/terrain/main.c)
|
||||
gen_sample(zclip samples/zclip/main.c)
|
||||
gen_sample(zclip_triangle samples/zclip_triangle/main.c)
|
||||
gen_sample(zclip_trianglestrip samples/zclip_trianglestrip/main.c)
|
||||
|
||||
if(PLATFORM_DREAMCAST)
|
||||
add_executable(polymark samples/polymark/main.c)
|
||||
gen_sample(polymark samples/polymark/main.c)
|
||||
gen_sample(quadmark samples/quadmark/main.c)
|
||||
gen_sample(trimark samples/trimark/main.c)
|
||||
endif()
|
||||
|
|
|
@ -187,7 +187,7 @@ int dtex_to_gl_texture(texture *tex, char* filename) {
|
|||
printf("Texture %s loaded\n", tex->path);
|
||||
|
||||
return(1);
|
||||
};
|
||||
}
|
||||
|
||||
void draw_textured_quad(texture *tex) {
|
||||
if(glIsTexture(tex->id)) {
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
#include <stdio.h>
|
||||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
#ifdef __DREAMCAST__
|
||||
extern uint8 romdisk[];
|
||||
KOS_INIT_ROMDISK(romdisk);
|
||||
#endif
|
||||
|
||||
/* floats for x rotation, y rotation, z rotation */
|
||||
float xrot, yrot, zrot;
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* output and incorrect depth testing
|
||||
*/
|
||||
|
||||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
/* A general OpenGL initialization function. Sets all of the initial parameters. */
|
||||
void InitGL(int Width, int Height) // We call this right after our OpenGL window is created.
|
||||
|
|
|
@ -4,13 +4,17 @@
|
|||
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glext.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
#ifdef __DREAMCAST__
|
||||
|
||||
#include <kos.h>
|
||||
extern uint8_t romdisk[];
|
||||
KOS_INIT_ROMDISK(romdisk);
|
||||
|
||||
#ifdef __DREAMCAST__
|
||||
#define IMAGE_FILENAME "/rd/NeHe.bmp"
|
||||
|
||||
#else
|
||||
#define IMAGE_FILENAME "samples/lights/romdisk/NeHe.bmp"
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
/* A general OpenGL initialization function. Sets all of the initial parameters. */
|
||||
void InitGL(int Width, int Height) // We call this right after our OpenGL window is created.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
/* A general OpenGL initialization function. Sets all of the initial parameters. */
|
||||
void InitGL(int Width, int Height) // We call this right after our OpenGL window is created.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
GLfloat rtri;
|
||||
GLfloat rquad;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
GLfloat rtri;
|
||||
GLfloat rquad;
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "glext.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
#include "GL/glext.h"
|
||||
|
||||
#ifdef __DREAMCAST__
|
||||
extern uint8 romdisk[];
|
||||
KOS_INIT_ROMDISK(romdisk);
|
||||
#endif
|
||||
|
||||
/* floats for x rotation, y rotation, z rotation */
|
||||
float xrot, yrot, zrot;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
/* A general OpenGL initialization function. Sets all of the initial parameters. */
|
||||
void InitGL(int Width, int Height) // We call this right after our OpenGL window is created.
|
||||
|
|
|
@ -9,8 +9,11 @@
|
|||
#include "GL/glext.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
extern uint8_t romdisk[];
|
||||
KOS_INIT_ROMDISK(romdisk);
|
||||
#ifdef __DREAMCAST__
|
||||
#include <kos.h>
|
||||
extern uint8 romdisk[];
|
||||
KOS_INIT_ROMDISK(romdisk);
|
||||
#endif
|
||||
|
||||
/* floats for x rotation, y rotation, z rotation */
|
||||
float xrot, yrot, zrot;
|
||||
|
|
|
@ -5,6 +5,10 @@ typedef enum
|
|||
true
|
||||
} bool;
|
||||
|
||||
#ifdef __DREAMCAST__
|
||||
#include <kos.h>
|
||||
#endif
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <kos.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glkos.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
#define TERRAIN_SIZE 100
|
||||
#define TERRAIN_SCALE 1.0f
|
||||
|
|
|
@ -37,8 +37,8 @@ LINK_DIRECTORIES($ENV{KOS_BASE}/lib/dreamcast)
|
|||
ENDIF()
|
||||
|
||||
|
||||
add_link_options(-L$ENV{KOS_BASE}/lib/dreamcast LINKER:--start-group -lstdc++ -lkallisti -lc -lgcc -Wl,--end-group)
|
||||
link_libraries(stdc++ kallisti c gcc m)
|
||||
add_link_options(-L$ENV{KOS_BASE}/lib/dreamcast)
|
||||
link_libraries(-Wl,--start-group -lstdc++ -lkallisti -lc -lgcc -Wl,--end-group m)
|
||||
|
||||
SET(CMAKE_EXECUTABLE_SUFFIX ".elf")
|
||||
SET(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
|
||||
|
|
Loading…
Reference in New Issue
Block a user