smidge of refactoring
This commit is contained in:
parent
a3b65ed3ff
commit
9e004cdb5b
|
@ -0,0 +1,7 @@
|
|||
# oglc
|
||||
|
||||
## sources
|
||||
|
||||
[learnogengl](https://learnopengl.com/)
|
||||
[Anton's OpenGL 4 Tutorials](https://antongerdelan.net/opengl/compute.html)
|
||||
|
|
@ -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()
|
||||
|
|
|
@ -9,9 +9,7 @@
|
|||
|
||||
#include "io.h"
|
||||
|
||||
void gfxInit();
|
||||
SDL_Window* getWindow();
|
||||
SDL_GLContext* getContext();
|
||||
SDL_Window* gfxInit();
|
||||
|
||||
unsigned int compileShaderProgram();
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@ float time();
|
|||
|
||||
int main()
|
||||
{
|
||||
gfxInit();
|
||||
SDL_Window* window = getWindow();
|
||||
SDL_Window* window = gfxInit();
|
||||
|
||||
// generate opengl texture
|
||||
unsigned int texture;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue