creado define para compilar sin shaders

This commit is contained in:
2024-07-05 23:57:26 +02:00
parent d36f3539cc
commit b770bdb7d1
4 changed files with 14 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
#ifndef RASPI #ifndef NO_SHADERS
#include "jshader.h" #include "jshader.h"
#include <iostream> #include <iostream>

View File

@@ -1,4 +1,4 @@
#ifndef RASPI #ifndef NO_SHADERS
#pragma once #pragma once

View File

@@ -3,7 +3,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <streambuf> #include <streambuf>
#ifndef RASPI #ifndef NO_SHADERS
#include "jshader.h" #include "jshader.h"
#endif #endif
@@ -81,7 +81,7 @@ void Screen::blit()
// Atenua la pantalla // Atenua la pantalla
doAttenuate(); doAttenuate();
#ifdef RASPI #ifdef NO_SHADERS
// Vuelve a dejar el renderizador en modo normal // Vuelve a dejar el renderizador en modo normal
SDL_SetRenderTarget(renderer, nullptr); SDL_SetRenderTarget(renderer, nullptr);
@@ -201,7 +201,7 @@ void Screen::setVideoMode(int videoMode)
} }
} }
#ifdef RASPI #ifdef NO_SHADERS
SDL_RenderSetLogicalSize(renderer, windowWidth, windowHeight); SDL_RenderSetLogicalSize(renderer, windowWidth, windowHeight);
#else #else
// Reinicia los shaders // Reinicia los shaders

View File

@@ -192,15 +192,14 @@ bool Director::initSDL()
std::cout << "Warning: texture filtering not enabled!\n"; std::cout << "Warning: texture filtering not enabled!\n";
} }
} }
#ifndef RASPI #ifndef NO_SHADERS
//if (options->video.shaders) if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl"))
if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl")) {
if (options->console)
{ {
if (options->console) std::cout << "Warning: opengl not enabled!\n";
{
std::cout << "Warning: opengl not enabled!\n";
}
} }
}
#endif #endif
// Crea la ventana // Crea la ventana
int incW = 0; int incW = 0;
@@ -227,12 +226,9 @@ bool Director::initSDL()
{ {
flags = flags | SDL_RENDERER_PRESENTVSYNC; flags = flags | SDL_RENDERER_PRESENTVSYNC;
} }
#ifndef RASPI #ifndef NO_SHADERS
// La aceleración se activa según las opciones // La aceleración se activa según el define
//if (options->video.shaders) flags = flags | SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE;
{
flags = flags | SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE;
}
#endif #endif
renderer = SDL_CreateRenderer(window, -1, flags); renderer = SDL_CreateRenderer(window, -1, flags);