Added some Raspberry Pi hacks
Also added a debug print that tells you what backend SDL2 is using
This commit is contained in:
parent
c4d514f789
commit
923cd5a6e3
2 changed files with 16 additions and 1 deletions
10
src/Draw.cpp
10
src/Draw.cpp
|
@ -86,11 +86,21 @@ BOOL StartDirectDraw(int lMagnification, int lColourDepth)
|
|||
//Initialize rendering
|
||||
SDL_InitSubSystem(SDL_INIT_VIDEO);
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
//Force OpenGLES2 on Raspberry Pi
|
||||
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengles2");
|
||||
#endif
|
||||
|
||||
//Create renderer
|
||||
gRenderer = SDL_CreateRenderer(gWindow, -1, SDL_RENDERER_ACCELERATED);
|
||||
|
||||
if (gRenderer != NULL)
|
||||
{
|
||||
//Print the name of the renderer SDL2 is using
|
||||
SDL_RendererInfo info;
|
||||
SDL_GetRendererInfo(gRenderer, &info);
|
||||
printf("Renderer: %s\n", info.name);
|
||||
|
||||
switch (lMagnification)
|
||||
{
|
||||
case 0:
|
||||
|
|
|
@ -11,7 +11,12 @@
|
|||
#include "PixTone.h"
|
||||
|
||||
#define FREQUENCY 44100
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#define STREAM_SIZE 0x400
|
||||
#else
|
||||
#define STREAM_SIZE (FREQUENCY / 200)
|
||||
#endif
|
||||
|
||||
#define clamp(x, y, z) ((x > z) ? z : (x < y) ? y : x)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue