Add some more samples to CMake
This commit is contained in:
parent
2cd4c813ad
commit
d2f8741fcc
|
@ -50,5 +50,7 @@ add_executable(nehe02 samples/nehe02/main.c)
|
|||
add_executable(blend_test samples/blend_test/main.c)
|
||||
add_executable(depth_funcs samples/depth_funcs/main.c)
|
||||
add_executable(depth_funcs_alpha_testing samples/depth_funcs_alpha_testing/main.c samples/depth_funcs_alpha_testing/gl_png.c)
|
||||
|
||||
add_executable(depth_funcs_ortho samples/depth_funcs_ortho/main.c)
|
||||
add_executable(lights samples/lights/main.c)
|
||||
add_executable(mipmap samples/mipmap/main.c)
|
||||
|
||||
|
|
|
@ -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,12 +1,19 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
extern uint8 romdisk[];
|
||||
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
|
||||
|
||||
float xrot, yrot, zrot;
|
||||
|
||||
|
@ -89,7 +96,7 @@ int ImageLoad(char *filename, Image *image) {
|
|||
}
|
||||
|
||||
if ((i = fread(image->data, size, 1, file)) != 1) {
|
||||
printf(stderr, "Error reading image data from %s.\n", filename);
|
||||
fprintf(stderr, "Error reading image data from %s.\n", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -115,7 +122,7 @@ void LoadGLTextures() {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
if (!ImageLoad("/rd/NeHe.bmp", image1)) {
|
||||
if (!ImageLoad(IMAGE_FILENAME, image1)) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "gl.h"
|
||||
#include "glu.h"
|
||||
#include "glkos.h"
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glext.h"
|
||||
#include "GL/glkos.h"
|
||||
|
||||
extern uint8 romdisk[];
|
||||
extern uint8_t romdisk[];
|
||||
KOS_INIT_ROMDISK(romdisk);
|
||||
|
||||
#ifdef __DREAMCAST__
|
||||
#define IMAGE_FILENAME "/rd/NeHe.bmp"
|
||||
#else
|
||||
#define IMAGE_FILENAME "samples/mipmap/romdisk/NeHe.bmp"
|
||||
#endif
|
||||
|
||||
/* storage for one texture */
|
||||
int texture[1];
|
||||
|
||||
|
@ -87,7 +95,7 @@ int ImageLoad(char *filename, Image *image) {
|
|||
}
|
||||
|
||||
if ((i = fread(image->data, size, 1, file)) != 1) {
|
||||
printf(stderr, "Error reading image data from %s.\n", filename);
|
||||
fprintf(stderr, "Error reading image data from %s.\n", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -113,7 +121,7 @@ void LoadGLTextures() {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
if (!ImageLoad("/rd/NeHe.bmp", image1)) {
|
||||
if (!ImageLoad(IMAGE_FILENAME, image1)) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user