shithub: cstory

Download patch

ref: 923cd5a6e3477ba9b97e877806afca00b2545372
parent: c4d514f789494bc9da9a549c68735ee325dba0e8
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Mar 18 16:54:03 EDT 2019

Added some Raspberry Pi hacks

Also added a debug print that tells you what backend SDL2 is using

--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -85,12 +85,22 @@
 
 	//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:
--- a/src/Sound.cpp
+++ b/src/Sound.cpp
@@ -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)