smidge of refactoring

This commit is contained in:
ktyl 2021-07-07 00:49:22 +01:00
parent a3b65ed3ff
commit 9e004cdb5b
5 changed files with 14 additions and 11 deletions

7
readme.md Normal file
View File

@ -0,0 +1,7 @@
# oglc
## sources
[learnogengl](https://learnopengl.com/)
[Anton's OpenGL 4 Tutorials](https://antongerdelan.net/opengl/compute.html)

View File

@ -6,12 +6,9 @@ const char* fragShaderPath = "res/shader/shader.frag";
SDL_Window* sdlWindow;
SDL_GLContext* sdlContext;
SDL_Window* getWindow() { return sdlWindow; }
SDL_GLContext* getContext() { return sdlContext; }
GLuint compileShader(const char* path, GLenum type);
void gfxInit()
SDL_Window* gfxInit()
{
// load sdl modules
if (SDL_Init(SDL_INIT_VIDEO) != 0)
@ -43,6 +40,8 @@ void gfxInit()
int availableAttributes;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &availableAttributes);
//printf("max vertex attributes %d\n", availableAttributes);
return sdlWindow;
}
unsigned int compileShaderProgram()

View File

@ -9,9 +9,7 @@
#include "io.h"
void gfxInit();
SDL_Window* getWindow();
SDL_GLContext* getContext();
SDL_Window* gfxInit();
unsigned int compileShaderProgram();

View File

@ -26,8 +26,7 @@ float time();
int main()
{
gfxInit();
SDL_Window* window = getWindow();
SDL_Window* window = gfxInit();
// generate opengl texture
unsigned int texture;

View File

@ -6775,8 +6775,8 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y,
stbi_uc *two_back = 0;
stbi__gif g;
int stride;
//int out_size = 0;
//int delays_size = 0;
int out_size = 0;
int delays_size = 0;
memset(&g, 0, sizeof(g));
if (delays) {
*delays = 0;