- Treballant en vore perque no me va en el comp del treball

This commit is contained in:
2025-06-10 13:52:02 +02:00
parent c862ba56e7
commit 2a9d714295
2 changed files with 24 additions and 1 deletions

View File

@@ -18,13 +18,14 @@ int main(int argc, char **argv)
printf("VIDEO DRIVERS AVAILABLE:\n");
for (int i=0; i<num_drivers;++i) printf("%i: %s\n", i, SDL_GetVideoDriver(i));
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
SDL_Renderer *renderer = SDL_CreateRenderer(win, NULL); //-1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
if (!renderer) { printf("ERROR al crear el renderer: %s\n", SDL_GetError()); }
SDL_Texture *texTarget = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET, WIDTH, HEIGHT);
if (!win) { printf("ERROR al crear la textura target: %s\n", SDL_GetError()); }
std::ifstream f("crtpi.glsl");
std::ifstream f("basic.glsl");
std::string source((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
shader::init(win, texTarget, source.c_str());