aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library_sdl.js19
-rw-r--r--tests/hello_world_sdl.cpp2
2 files changed, 4 insertions, 17 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 806ed0ec..9e305bec 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -78,14 +78,12 @@
// load-store consistency assumption, it should be written that way (see docs/paper.pdf).
// Instead, do something like *ptr++ = R; *ptr++ = G; *ptr++ = B;
//
-// * SQL_Quit will wipe the screen with random noise. This is intentional, in order
-// to make it clear when SDL has shut down (which could be due to an error). If you
-// want your output to remain on the screen, do not call SDL_Quit.
-//
// * A normal C++ main loop with SDL_Delay will not work in JavaScript - there is no way
// to wait for a short time without locking up the web page entirely. The simplest
// solution here is to have a singleIteration() function which is a single loop
// iteration, and from JS to do something like setInterval(_singleIteration, 1/30)
+//
+// * SQL_Quit does nothing.
mergeInto(LibraryManager.library, {
$SDL__deps: ['$Browser'],
@@ -267,18 +265,7 @@ mergeInto(LibraryManager.library, {
},
SDL_Quit: function() {
- var surfData = SDL.surfaces[SDL.screen];
- if (surfData) {
- surfData.image = surfData.ctx.getImageData(0, 0, surfData.width, surfData.height);
- var num = surfData.image.data.length;
- for (var i = 0; i < num; i++) {
- surfData.image.data[i] = Math.floor(Math.random()*255);
- }
- surfData.ctx.putImageData(surfData.image, 0, 0);
- }
- if (SDL.audio) _SDL_CloseAudio(); // make sure we don't leave our audio timer running
- __shutdownRuntime__();
- throw 'SDL_Quit!';
+ print('SQL_Quit called (and ignored)');
},
SDL_LockSurface: function(surf) {
diff --git a/tests/hello_world_sdl.cpp b/tests/hello_world_sdl.cpp
index a317c0c5..f3fb8ae7 100644
--- a/tests/hello_world_sdl.cpp
+++ b/tests/hello_world_sdl.cpp
@@ -22,7 +22,7 @@ int main() {
printf("you should see a colored cube.");
- // SDL_Quit(); // Don't call SDL_Quit so that the canvas is not cleared
+ SDL_Quit();
return 0;
}