diff --git a/.editorconfig b/.editorconfig index 7e528b9..c99183e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -# C [{*.c,*.h}] indent_style = space indent_size = 2 diff --git a/.gitignore b/.gitignore index 4104693..e660fd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1 @@ -# windows binary -*.exe - -# unix binary -fps_counter -rotate_cube +bin/ diff --git a/Makefile b/Makefile index 955b115..2ad33d9 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ CC=tcc all: fps_counter rotate_cube fps_counter: - $(CC) src/fps_counter/fps_counter.c -lglfw -lGL -o fps_counter + $(CC) src/fps_counter/fps_counter.c -lglfw -lGL -o ./bin/fps_counter rotate_cube: - $(CC) src/rotate_cube/rotate_cube.c -lglfw -lGL -o rotate_cube + $(CC) src/rotate_cube/rotate_cube.c -lglfw -lGL -o ./bin/rotate_cube diff --git a/README.md b/README.md index 4605890..8d4c4e7 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ GLFW Examples Примеры ------- ### Вращающийся куб -[[Ссылка](rotate_cube/)] +[[Ссылка](rotate_cube/)] ![Preview](src/rotate_cube/rotate_cube.png) ### Счётчик FPS в заголовке окна -[[Ссылка](fps_counter/)] +[[Ссылка](fps_counter/)] ![Preview](src/fps_counter/fps_counter.png) diff --git a/src/rotate_cube/rotate_cube.c b/src/rotate_cube/rotate_cube.c index 95e3a68..d99b98e 100644 --- a/src/rotate_cube/rotate_cube.c +++ b/src/rotate_cube/rotate_cube.c @@ -29,7 +29,7 @@ int main(int argc, char const *argv[]) glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); window = glfwCreateWindow(320, 320, "Rorate Cube", NULL, NULL); - + if (!window) { glfwTerminate(); @@ -48,10 +48,10 @@ int main(int argc, char const *argv[]) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); - + glRotatef(rotate_x, 1.0, 0.0, 0.0); glRotatef(rotate_y, 0.0, 1.0, 0.0); - + glBegin(GL_POLYGON); // Yellow side - FRONT glColor3f(1.0, 1.0, 0.0); glVertex3f( 0.5, -0.5, -0.5); @@ -59,7 +59,7 @@ int main(int argc, char const *argv[]) glVertex3f(-0.5, 0.5, -0.5); glVertex3f(-0.5, -0.5, -0.5); glEnd(); - + glBegin(GL_POLYGON); // White side - BACK glColor3f(1.0, 1.0, 1.0); glVertex3f( 0.5, -0.5, 0.5); @@ -67,7 +67,7 @@ int main(int argc, char const *argv[]) glVertex3f(-0.5, 0.5, 0.5); glVertex3f(-0.5, -0.5, 0.5); glEnd(); - + glBegin(GL_POLYGON); // Purple side - RIGHT glColor3f(1.0, 0.0, 1.0); glVertex3f(0.5, -0.5, -0.5); @@ -75,7 +75,7 @@ int main(int argc, char const *argv[]) glVertex3f(0.5, 0.5, 0.5); glVertex3f(0.5, -0.5, 0.5); glEnd(); - + glBegin(GL_POLYGON); // Green side - LEFT glColor3f(0.0, 1.0, 0.0); glVertex3f(-0.5, -0.5, 0.5); @@ -83,7 +83,7 @@ int main(int argc, char const *argv[]) glVertex3f(-0.5, 0.5, -0.5); glVertex3f(-0.5, -0.5, -0.5); glEnd(); - + glBegin(GL_POLYGON); // Blue side - TOP glColor3f(0.0, 0.0, 1.0); glVertex3f( 0.5, 0.5, 0.5); @@ -91,7 +91,7 @@ int main(int argc, char const *argv[]) glVertex3f(-0.5, 0.5, -0.5); glVertex3f(-0.5, 0.5, 0.5); glEnd(); - + glBegin(GL_POLYGON); // Red side - BOTTOM glColor3f(1.0, 0.0, 0.0); glVertex3f( 0.5, -0.5, -0.5); @@ -99,7 +99,7 @@ int main(int argc, char const *argv[]) glVertex3f(-0.5, -0.5, 0.5); glVertex3f(-0.5, -0.5, -0.5); glEnd(); - + glfwSwapBuffers(window); glfwPollEvents(); }