mirror of https://github.com/encounter/SDL.git
93a520b385
Sylvain This still happens with the current trunk version. (software renderer of testdrawchessboard.c) When there is a rotation, the window size changed and the internal surface is marked as "surface_valid == SDL_FALSE". And all further call fails. SDL_video.c : 2478 void 2479 SDL_OnWindowResized(SDL_Window * window) 2480 { 2481 window->surface_valid = SDL_FALSE; 2482 SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h); 2483 } some error set to : 2233 return SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface"); So, this seems to be the behavior of the API ... In the loop() function of testdrawchessboard.c, we can recreate the surface/renderer : 65 if (e.type == SDL_WINDOWEVENT) 66 { 67 if (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) 68 { 69 surface = SDL_GetWindowSurface(window); 70 renderer = SDL_CreateSoftwareRenderer(surface); 71 } 72 /* Clear the rendering surface with the specified color */ 73 SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); 74 SDL_RenderClear(renderer); 75 } And it displays correctly. |
||
---|---|---|
.. | ||
emscripten | ||
nacl | ||
shapes | ||
COPYING | ||
Makefile.in | ||
README | ||
acinclude.m4 | ||
aclocal.m4 | ||
autogen.sh | ||
axis.bmp | ||
button.bmp | ||
checkkeys.c | ||
configure | ||
configure.in | ||
controllermap.bmp | ||
controllermap.c | ||
gcc-fat.sh | ||
icon.bmp | ||
loopwave.c | ||
loopwavequeue.c | ||
moose.dat | ||
picture.xbm | ||
relative_mode.markdown | ||
sample.bmp | ||
sample.wav | ||
testatomic.c | ||
testaudiocapture.c | ||
testaudiohotplug.c | ||
testaudioinfo.c | ||
testautomation.c | ||
testautomation_audio.c | ||
testautomation_clipboard.c | ||
testautomation_events.c | ||
testautomation_hints.c | ||
testautomation_keyboard.c | ||
testautomation_main.c | ||
testautomation_mouse.c | ||
testautomation_pixels.c | ||
testautomation_platform.c | ||
testautomation_rect.c | ||
testautomation_render.c | ||
testautomation_rwops.c | ||
testautomation_sdltest.c | ||
testautomation_stdlib.c | ||
testautomation_suites.h | ||
testautomation_surface.c | ||
testautomation_syswm.c | ||
testautomation_timer.c | ||
testautomation_video.c | ||
testbounds.c | ||
testcustomcursor.c | ||
testdisplayinfo.c | ||
testdraw2.c | ||
testdrawchessboard.c | ||
testdropfile.c | ||
testerror.c | ||
testfile.c | ||
testfilesystem.c | ||
testgamecontroller.c | ||
testgesture.c | ||
testgl2.c | ||
testgles.c | ||
testgles2.c | ||
testhaptic.c | ||
testhittesting.c | ||
testhotplug.c | ||
testiconv.c | ||
testime.c | ||
testintersections.c | ||
testjoystick.c | ||
testkeys.c | ||
testloadso.c | ||
testlock.c | ||
testmessage.c | ||
testmultiaudio.c | ||
testnative.c | ||
testnative.h | ||
testnativecocoa.m | ||
testnativew32.c | ||
testnativex11.c | ||
testoverlay2.c | ||
testplatform.c | ||
testpower.c | ||
testqsort.c | ||
testrelative.c | ||
testrendercopyex.c | ||
testrendertarget.c | ||
testresample.c | ||
testrumble.c | ||
testscale.c | ||
testsem.c | ||
testshader.c | ||
testshape.c | ||
testsprite2.c | ||
testspriteminimal.c | ||
teststreaming.c | ||
testthread.c | ||
testtimer.c | ||
testver.c | ||
testviewport.c | ||
testwm2.c | ||
torturethread.c | ||
utf8.txt |
README
These are test programs for the SDL library: checkkeys Watch the key events to check the keyboard loopwave Audio test -- loop playing a WAV file loopwavequeue Audio test -- loop playing a WAV file with SDL_QueueAudio testaudioinfo Lists audio device capabilities testerror Tests multi-threaded error handling testfile Tests RWops layer testgl2 A very simple example of using OpenGL with SDL testiconv Tests international string conversion testjoystick List joysticks and watch joystick events testkeys List the available keyboard keys testloadso Tests the loadable library layer testlock Hacked up test of multi-threading and locking testmultiaudio Tests using several audio devices testoverlay2 Tests the overlay flickering/scaling during playback. testplatform Tests types, endianness and cpu capabilities testsem Tests SDL's semaphore implementation testshape Tests shaped windows testsprite2 Example of fast sprite movement on the screen testthread Hacked up test of multi-threading testtimer Test the timer facilities testver Check the version and dynamic loading and endianness testwm2 Test window manager -- title, icon, events torturethread Simple test for thread creation/destruction controllermap Useful to generate Game Controller API compatible maps This directory contains sample.wav, which is a sample from Will Provost's song, The Living Proof: From the album The Living Proof Publisher: 5 Guys Named Will Copyright 1996 Will Provost You can get a copy of the full song (and album!) from iTunes... https://itunes.apple.com/us/album/the-living-proof/id4153978 or Amazon... http://www.amazon.com/The-Living-Proof-Will-Provost/dp/B00004R8RH Thanks to Will for permitting us to distribute this sample with SDL!