From a5d473dfc0ca64a6aceba0cea3db663134f73d37 Mon Sep 17 00:00:00 2001 From: ZoRo Date: Wed, 21 Oct 2020 21:55:18 +0100 Subject: Clean all source --- fractal.c | 125 ++------------------------------------------------------------ 1 file changed, 4 insertions(+), 121 deletions(-) diff --git a/fractal.c b/fractal.c index 2f01a7f..783ad87 100644 --- a/fractal.c +++ b/fractal.c @@ -159,18 +159,6 @@ void generate_koh(int gener, double size, int posx, int posy, double k) generate_koh(gener-1, t_size, posx+size-t_size/2, posy-t_size/2, k); } -void Rect( GLfloat w, GLfloat h ) -{ - /* - glBegin( GL_QUADS ); - glVertex3f( -w, h, 0.0f ); - glVertex3f( w, h, 0.0f ); - glVertex3f( w, -h, 0.0f ); - glVertex3f( -w, -h, 0.0f ); - glEnd(); - */ -} - void Triangle( int x, int y, int w, int h) { // An array of 3 vectors which represents 3 vertices @@ -206,7 +194,6 @@ void Triangle( int x, int y, int w, int h) } - // Shader sources const GLchar* vertexSource = "attribute vec4 position; \n" @@ -221,48 +208,12 @@ const GLchar* fragmentSource = " gl_FragColor = vec4 (1.0, 1.0, 1.0, 1.0 );\n" "} \n"; - GLuint vertexShader; GLuint fragmentShader; GLuint shaderProgram; GLint posAttrib; - void RectPX( int x, int y,int w, int h ) -{ - GLfloat x1 = (1.0f*x-SCREEN_WIDTH2)/SCREEN_WIDTH2; - GLfloat y1 = (1.0f*y-SCREEN_HEIGHT2)/SCREEN_HEIGHT2; - GLfloat x2 = (1.0f*(x+w)-SCREEN_WIDTH2)/SCREEN_WIDTH2; - GLfloat y2 = (1.0f*(y+h)-SCREEN_HEIGHT2)/SCREEN_HEIGHT2; - GLfloat vVertices[] = { 0.0f, 0.5f, 0.0f, - -0.5f, -0.5f, 0.0f, - 0.5f, -0.5f, 0.0f }; - GLuint vertexPosObject; - glGenBuffers(1, &vertexPosObject); - glBindBuffer(GL_ARRAY_BUFFER, vertexPosObject); - glBufferData(GL_ARRAY_BUFFER, 9*4, vVertices, GL_STATIC_DRAW); - //glClear ( GL_COLOR_BUFFER_BIT ); - glEnableVertexAttribArray(0); - glBindBuffer(GL_ARRAY_BUFFER, vertexPosObject); - glVertexAttribPointer(0 /* ? */, 3, GL_FLOAT, GL_FALSE, 0, 0); - - glDrawArrays ( GL_TRIANGLES, 0, 3 ); - - - - /* - glBegin( GL_QUADS ); - glVertex3f( x1, y2, 0.0f ); - glVertex3f( x2, y2, 0.0f ); - glVertex3f( x2, y1, 0.0f ); - glVertex3f( x1, y1, 0.0f ); - glEnd(); - */ - -} - - -void RectPX2( int x, int y,int w, int h ) { GLfloat x1 = (1.0f*x-SCREEN_WIDTH2)/SCREEN_WIDTH2; GLfloat y1 = (1.0f*y-SCREEN_HEIGHT2)/SCREEN_HEIGHT2; @@ -298,8 +249,6 @@ int main_tick() { int i,j; SDL_Event event; SDL_StartTextInput(); - //while (quit == 0) - //{ while (SDL_PollEvent(&event)) { @@ -310,25 +259,15 @@ int main_tick() { quit = 1; break; } - //case SDL_KE } - - //sleep(1); } - - - //SDL_SetRenderDrawColor(renderer, 0, 100, 0, 0); - //SDL_RenderClear(renderer); - //SDL_RenderPresent(renderer); glClear( GL_COLOR_BUFFER_BIT ); - //glLoadIdentity(); for (i=0;i<=MAX_GENERATION;i++) { //rgba32_t c = color_gen_shade(start_col, i, MAX_GENERATION); rgba32_t c = color_gen_mainlv(start_col, i, MAX_GENERATION); - //glColor3f( c.r , c.g , c.b ); //static int once=0 for (j=0;j