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_Window* sdlWindow;
|
||||||
SDL_GLContext* sdlContext;
|
SDL_GLContext* sdlContext;
|
||||||
|
|
||||||
SDL_Window* getWindow() { return sdlWindow; }
|
|
||||||
SDL_GLContext* getContext() { return sdlContext; }
|
|
||||||
|
|
||||||
GLuint compileShader(const char* path, GLenum type);
|
GLuint compileShader(const char* path, GLenum type);
|
||||||
|
|
||||||
void gfxInit()
|
SDL_Window* gfxInit()
|
||||||
{
|
{
|
||||||
// load sdl modules
|
// load sdl modules
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) != 0)
|
if (SDL_Init(SDL_INIT_VIDEO) != 0)
|
||||||
|
@ -43,6 +40,8 @@ void gfxInit()
|
||||||
int availableAttributes;
|
int availableAttributes;
|
||||||
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &availableAttributes);
|
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &availableAttributes);
|
||||||
//printf("max vertex attributes %d\n", availableAttributes);
|
//printf("max vertex attributes %d\n", availableAttributes);
|
||||||
|
|
||||||
|
return sdlWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int compileShaderProgram()
|
unsigned int compileShaderProgram()
|
||||||
|
|
|
@ -9,9 +9,7 @@
|
||||||
|
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
void gfxInit();
|
SDL_Window* gfxInit();
|
||||||
SDL_Window* getWindow();
|
|
||||||
SDL_GLContext* getContext();
|
|
||||||
|
|
||||||
unsigned int compileShaderProgram();
|
unsigned int compileShaderProgram();
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,7 @@ float time();
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
gfxInit();
|
SDL_Window* window = gfxInit();
|
||||||
SDL_Window* window = getWindow();
|
|
||||||
|
|
||||||
// generate opengl texture
|
// generate opengl texture
|
||||||
unsigned int 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_uc *two_back = 0;
|
||||||
stbi__gif g;
|
stbi__gif g;
|
||||||
int stride;
|
int stride;
|
||||||
//int out_size = 0;
|
int out_size = 0;
|
||||||
//int delays_size = 0;
|
int delays_size = 0;
|
||||||
memset(&g, 0, sizeof(g));
|
memset(&g, 0, sizeof(g));
|
||||||
if (delays) {
|
if (delays) {
|
||||||
*delays = 0;
|
*delays = 0;
|
||||||
|
|
Loading…
Reference in New Issue