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
12
src/Draw.cpp
12
src/Draw.cpp
|
@ -85,12 +85,22 @@ BOOL StartDirectDraw(int lMagnification, int lColourDepth)
|
||||||
|
|
||||||
//Initialize rendering
|
//Initialize rendering
|
||||||
SDL_InitSubSystem(SDL_INIT_VIDEO);
|
SDL_InitSubSystem(SDL_INIT_VIDEO);
|
||||||
|
|
||||||
|
#ifdef RASPBERRY_PI
|
||||||
|
//Force OpenGLES2 on Raspberry Pi
|
||||||
|
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengles2");
|
||||||
|
#endif
|
||||||
|
|
||||||
//Create renderer
|
//Create renderer
|
||||||
gRenderer = SDL_CreateRenderer(gWindow, -1, SDL_RENDERER_ACCELERATED);
|
gRenderer = SDL_CreateRenderer(gWindow, -1, SDL_RENDERER_ACCELERATED);
|
||||||
|
|
||||||
if (gRenderer != NULL)
|
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)
|
switch (lMagnification)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -11,7 +11,12 @@
|
||||||
#include "PixTone.h"
|
#include "PixTone.h"
|
||||||
|
|
||||||
#define FREQUENCY 44100
|
#define FREQUENCY 44100
|
||||||
|
|
||||||
|
#ifdef RASPBERRY_PI
|
||||||
|
#define STREAM_SIZE 0x400
|
||||||
|
#else
|
||||||
#define STREAM_SIZE (FREQUENCY / 200)
|
#define STREAM_SIZE (FREQUENCY / 200)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define clamp(x, y, z) ((x > z) ? z : (x < y) ? y : x)
|
#define clamp(x, y, z) ((x > z) ? z : (x < y) ? y : x)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue