diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index a7c3cbe..bbbe344 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -9,9 +9,9 @@ on: jobs: build: runs-on: ubuntu-latest - container: ps2dev/ps2sdk-ports:latest + container: ps2dev/ps2sdk:latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | @@ -43,6 +43,7 @@ jobs: cd examples cd box && make clean all && cd .. cd logo && make clean all && cd .. + cd performance && make clean all && cd .. cd tricked_out && make clean all && cd .. cd nehe/lesson02 && make clean all && cd ../.. cd nehe/lesson03 && make clean all && cd ../.. @@ -51,7 +52,7 @@ jobs: - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: examples path: | diff --git a/examples/logo/logo.cpp b/examples/logo/logo.cpp index b8d3705..47f3826 100644 --- a/examples/logo/logo.cpp +++ b/examples/logo/logo.cpp @@ -14,9 +14,6 @@ #include "GL/gl.h" #include "GL/glut.h" -// in 'shared_code' -#include "file_ops.h" - #include "ps2glmesh.h" /******************************************** @@ -79,12 +76,7 @@ GLint ps2_list, gl_list, wet_list, circle_list, tri_list, square_list, x_list; int main(int argc, char** argv) { - int dummy_argc = 1; - char iop_module_path[] = "iop_module_path=host0:/usr/local/sce/iop/modules"; - char* dummy_argv[1]; - dummy_argv[0] = iop_module_path; - - glutInit(&dummy_argc, (char**)dummy_argv); + glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutCreateWindow(argv[0]); @@ -128,8 +120,8 @@ void init_models(void) // ps2 ps2_list = glGenLists(7); - mesh = LoadMesh(FILE_PREFIX "ps2.gl"); - LoadRTexFile(FILE_PREFIX "plywd_b.rtx", tex_ids[0]); + mesh = LoadMesh("ps2.gl"); + LoadRTexFile("plywd_b.rtx", tex_ids[0]); glNewList(ps2_list, GL_COMPILE); { glPushMatrix(); @@ -142,8 +134,8 @@ void init_models(void) // gl gl_list = ps2_list + 1; - mesh = LoadMesh(FILE_PREFIX "gl.gl"); - LoadRTexFile(FILE_PREFIX "plywd_y.rtx", tex_ids[1]); + mesh = LoadMesh("gl.gl"); + LoadRTexFile("plywd_y.rtx", tex_ids[1]); glNewList(gl_list, GL_COMPILE); { glBindTexture(GL_TEXTURE_2D, tex_ids[1]); @@ -154,8 +146,8 @@ void init_models(void) // wet paint wet_list = ps2_list + 2; - mesh = LoadMesh(FILE_PREFIX "note.gl"); - LoadRTexFile(FILE_PREFIX "wetpaint.rtx", tex_ids[2]); + mesh = LoadMesh("note.gl"); + LoadRTexFile("wetpaint.rtx", tex_ids[2]); glNewList(wet_list, GL_COMPILE); { glBindTexture(GL_TEXTURE_2D, tex_ids[2]); @@ -167,7 +159,7 @@ void init_models(void) // circle circle_list = ps2_list + 3; - mesh = LoadMesh(FILE_PREFIX "cir.gl"); + mesh = LoadMesh("cir.gl"); glNewList(circle_list, GL_COMPILE); { DrawMesh(mesh); @@ -177,7 +169,7 @@ void init_models(void) // square square_list = ps2_list + 4; - mesh = LoadMesh(FILE_PREFIX "sq.gl"); + mesh = LoadMesh("sq.gl"); glNewList(square_list, GL_COMPILE); { DrawMesh(mesh); @@ -187,7 +179,7 @@ void init_models(void) // triangle tri_list = ps2_list + 5; - mesh = LoadMesh(FILE_PREFIX "tri.gl"); + mesh = LoadMesh("tri.gl"); glNewList(tri_list, GL_COMPILE); { DrawMesh(mesh); @@ -197,7 +189,7 @@ void init_models(void) // x x_list = ps2_list + 6; - mesh = LoadMesh(FILE_PREFIX "x.gl"); + mesh = LoadMesh("x.gl"); glNewList(x_list, GL_COMPILE); { DrawMesh(mesh); diff --git a/examples/nehe/lesson04/lesson4.cpp b/examples/nehe/lesson04/lesson4.cpp index 7923db9..2b44825 100644 --- a/examples/nehe/lesson04/lesson4.cpp +++ b/examples/nehe/lesson04/lesson4.cpp @@ -35,6 +35,9 @@ void init(GLvoid) // Create Some Everyday Functions glEnable(GL_LIGHT0); } +void idle(void) { +} + void display(void) // Create The Display Function { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer @@ -92,7 +95,7 @@ int main(int argc, char **argv) // Create Main Function For Bri glutCreateWindow("NeHe's OpenGL Framework"); // Window Title (argv[0] for current directory as title) glutDisplayFunc(display); // Matching Earlier Functions To Their Counterparts glutReshapeFunc(reshape); - glutIdleFunc(display); + glutIdleFunc(idle); glutMainLoop(); // Initialize The Main Loop return 0; diff --git a/examples/nehe/lesson05/lesson5.cpp b/examples/nehe/lesson05/lesson5.cpp index 17e0e59..7edaa08 100644 --- a/examples/nehe/lesson05/lesson5.cpp +++ b/examples/nehe/lesson05/lesson5.cpp @@ -35,6 +35,10 @@ void InitGL(GLvoid) // Create Some Everyday Functions glEnable(GL_LIGHT0); } +void idle(void) { + +} + void display(void) // Create The Display Function { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer @@ -143,7 +147,7 @@ int main(int argc, char **argv) // Create Main Function For Br InitGL(); glutDisplayFunc(display); // Matching Earlier Functions To Their Counterparts glutReshapeFunc(reshape); - glutIdleFunc(display); + glutIdleFunc(idle); glutMainLoop(); // Initialize The Main Loop return 0; diff --git a/examples/performance/Makefile b/examples/performance/Makefile index 5d04fa7..31f35ec 100644 --- a/examples/performance/Makefile +++ b/examples/performance/Makefile @@ -2,8 +2,8 @@ EE_BIN = performance.elf EE_CFLAGS := -I$(PS2SDK)/ports/include -I../shared_code/ $(EE_CFLAGS) EE_CXXFLAGS := -I$(PS2SDK)/ports/include -I../shared_code/ $(EE_CXXFLAGS) EE_OBJS = performance.o ../shared_code/text_stuff.o -EE_LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -EE_LIBS = -lps2glut -lps2gl -lps2stuff -lpad -ldma -lgs -lpacket -lgraph -lgskit -ldmakit +EE_LDFLAGS += -L$(PS2SDK)/ports/lib +EE_LIBS = -lps2glut -lps2gl -lps2stuff -lpad -ldma -lgs -lpacket -lgraph ifeq ($(DEBUG), 1) EE_CFLAGS += -D_DEBUG diff --git a/examples/performance/performance.cpp b/examples/performance/performance.cpp index d1399c6..71556c6 100644 --- a/examples/performance/performance.cpp +++ b/examples/performance/performance.cpp @@ -571,6 +571,8 @@ void display(void) // printf("\n"); display_ticks = timer1->GetTicks(); + + glutSwapBuffers(); } void perspective(float fov, float aspect, float nearClip, float farClip) diff --git a/examples/shared_code/file_ops.h b/examples/shared_code/file_ops.h deleted file mode 100644 index 6fc53c8..0000000 --- a/examples/shared_code/file_ops.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000,2001,2002 Sony Computer Entertainment America - - This file is subject to the terms and conditions of the GNU Lesser - General Public License Version 2.1. See the file "COPYING" in the - main directory of this archive for more details. */ - -#ifndef file_ops_h -#define file_ops_h - -#include "stdio.h" -#ifdef CDROM -#define FILE_PREFIX "cdrom0:" -#define FILE_SEP '\\' -#define FILE_TERM ";1" -#else -#define FILE_PREFIX "host0:" -#define FILE_SEP '/' -#define FILE_TERM "" -#endif - -#endif // file_ops_h diff --git a/examples/tricked_out/tricked_out.cpp b/examples/tricked_out/tricked_out.cpp index 0a4718b..06cc93d 100644 --- a/examples/tricked_out/tricked_out.cpp +++ b/examples/tricked_out/tricked_out.cpp @@ -18,7 +18,6 @@ #include "ps2s/eetimer.h" #include "ps2s/math.h" -#include "file_ops.h" #include "text_stuff.h" #include "billboard_renderer.h" @@ -189,7 +188,7 @@ void init_billboards() void load_bb_texture() { // the texture file is just an rgba image with no header info - int tex_fd = open(FILE_PREFIX "car.bin", O_RDONLY); + int tex_fd = open("car.bin", O_RDONLY); assert(tex_fd != -1); int image_size = 128 * 128 * 4; // 128x128 32-bit image diff --git a/glut/Makefile b/glut/Makefile index 0109b39..7587e6a 100644 --- a/glut/Makefile +++ b/glut/Makefile @@ -1,7 +1,7 @@ EE_LIB = libps2glut.a -EE_LDFLAGS += -L. -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -EE_INCS += -I./include -I$(PS2SDK)/ports/include -I$(PS2DEV)/gsKit/include +EE_LDFLAGS += -L. -L$(PS2SDK)/ports/lib +EE_INCS += -I./include -I$(PS2SDK)/ports/include ifeq ($(DEBUG), 1) EE_CFLAGS += -D_DEBUG