1. 08 Jan, 2012 3 commits
    • Sam Lantinga's avatar
      Updated Xcode project · 6ebbe99d
      Sam Lantinga authored
      6ebbe99d
    • Sam Lantinga's avatar
    • Sam Lantinga's avatar
      X11 OpenGL ES minor corrections · f7ad18f9
      Sam Lantinga authored
      Scott Percival 2012-01-08 04:21:22 PST
      
      I tested the new build on my two ARM machines, and fixed a few bugs:
      - if SDL_VIDEO_DRIVER_UIKIT, SDL_VIDEO_DRIVER_ANDROID or
      SDL_VIDEO_DRIVER_PANDORA are specified, function pointers are grabbed from the
      compile-linked library instead of through SDL_GL_GetProcAddress. (not sure if
      this is the best way to go about it)
      - removing "/usr/lib/" from all the library names (hey, with multiarch you
      can't be too sure anymore)
      - added glFinish to glesfuncs.h
      - changed the eglGetProcAddress arg type to "const char *" as per the EGL spec
      - filled in the stubs for X11_GLES_SetSwapInterval and X11_GLES_GetSwapInterval
      f7ad18f9
  2. 26 Aug, 2011 1 commit
  3. 08 Jan, 2012 12 commits
    • Sam Lantinga's avatar
      Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11 · 296e78b6
      Sam Lantinga authored
      Scott Percival 2011-07-03 06:41:51 PDT
      
      This submission is aimed at making life easier for OpenGL ES capable devices
      running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not
      running Android). SDL's Pandora support already has the neccesary GLES-to-X11
      glue code, however it's all ghetto'd off in Makefile.pandora and not very
      flexible.
      
      The patch:
      - adds an awesome --enable-video-opengles option to configure
      - re-modifies the opengles and opengles2 SDL_renderers to use function pointers
      - no idea why this was removed?
      - for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or
      libGLESv2 at runtime
      - links in libEGL.so at runtime - the old code made an assumption that
      eglFunctions could be pulled from the active GLES library, PowerVR for one
      doesn't let you do that with their libGLESv2
      - allows you to pick which of GLES v1 or v2 to load via
      SDL_GL_CONTEXT_MAJOR_VERSION
      
      So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and
      a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well,
      everything that isn't those two, such as a Pandora, iOS or Android device. The
      Pandora specific code should be kept intact (fingers crossed), and nothing
      painfully drastic has been added to the SDL_renderers. The library loading
      sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's
      propensity to let developers get away with murder and PowerVR's alternative of
      punishing every missed step.
      
      The test apps work okay with GLES or GLES2 as the renderer. For some reason
      alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out
      a new set of X11 GLES drivers, so I'll try and investigate once I upgrade
      those. Also, this patch adds things to configure.in, include/SDL_config.h.in
      and test/configure.in. I didn't know what the policy was re. committing
      generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry.
      
      I think that's about everything, let me know if there's anything I've
      overlooked.
      296e78b6
    • Sam Lantinga's avatar
      Fixed bug 1287 - VS2010 project doesn't include the SDL_syscond.c file · 02fe2020
      Sam Lantinga authored
      Liam 2011-08-23 09:09:18 PDT
      Hiya!
      
      Seems like there's no implementation of condition variables included when
      building with VS2010, adding the generic SDL_syscond.c file to the project
      seems to fix it right up.
      02fe2020
    • Sam Lantinga's avatar
      Fixed bug 1293 - [Android] Support Pause/Resume · 64d81471
      Sam Lantinga authored
      Gabriel Jacobo 2011-12-23 12:55:11 PST
      
      The attached files provide some improvement over the current handling of
      pause/resume in Android.
      - I disabled the exit(status) instruction in SDL_main as that makes the entire
      app instead of the SDL thread exit (while not needed for pause/resume it is
      needed for Live Wallpapers, an SDLActivity for which I'll upload in a separate
      bug).
      - Added nativePause and nativeResume which basically just mark the window as
      visible/hidden, something that the end user needs to take into consideration
      (ideally pausing the event loop).
      
      Also, this arrangement creates a new GL context when needed, which at least in
      my test system is every time you go away from the app and come back to it. So,
      this means that the textures need to be generated again after resuming (a
      problem the end user didn't have before because the app exited completely when
      it should've been pausing). I'd like to know if there's a standard way of
      letting the user know that the GL context has changed and that he needs to
      refresh his textures, or if this is out of the scope of the library and each
      user handles it in their own way (I don't know how/if this same thing is
      handled in  the iPhone backend, but it would be wise to try to imitate that).
      
      Gabriel Jacobo 2011-12-23 12:57:10 PST
      Also, in the SDLActivity the EGL handling code is moved up to the Activity from
      the Surface code, as I think it is possible (in theory) that the surface is
      destroyed temporarily while the context remains alive (though in practice in my
      test system this is not the case)
      64d81471
    • Sam Lantinga's avatar
      Fixed bug 1303 - SDL_CreateFromWindow duplicates window (Cocoa only) · d344b8d4
      Sam Lantinga authored
      Jens Köhler 2011-09-09 04:47:40 PDT
      
      When calling SDL_CreateWindowFrom with a NSWindow which already contains a
      NSView, the window will be duplicated because another NSView is added. I
      attached a possible fix that prevents the creation of a second NSView.
      d344b8d4
    • Sam Lantinga's avatar
      Fixed bug 1305 - mouse wheel scroll-down event created when mouse wheel is pressed down · 0093511f
      Sam Lantinga authored
      Martin Schreiber 2011-09-15 06:08:38 PDT
      
      patch attached
      0093511f
    • Sam Lantinga's avatar
      The #define was asking to use dlopen(), but the code wasn't doing it. · 09758809
      Sam Lantinga authored
      Also added error message in case the library open failed in that case.
      09758809
    • Sam Lantinga's avatar
    • Sam Lantinga's avatar
      Fixed bug 1313 - Segfault on SDL_CreateWindow when gl lib cannot be loaded · 5b2a5e34
      Sam Lantinga authored
      Don't crash if the gl_data isn't valid, just return NULL.
      5b2a5e34
    • Sam Lantinga's avatar
      Fixed bug 1333 - segfault if opengl window could not get created · 1dafe0e9
      Sam Lantinga authored
      When the window couldn't be created, the normal window destruction process happens, which among other things, destroys the framebuffer, if any.
      1dafe0e9
    • Sam Lantinga's avatar
      Fixed bug 1342 - SDL_CreateRenderer creates OpenGL ES 2.0 renderer in iPhone... · 5258e42d
      Sam Lantinga authored
      Fixed bug 1342 - SDL_CreateRenderer creates OpenGL ES 2.0 renderer in iPhone 3G using default index (-1)
      
      The uikit code wasn't checking to make sure the context was successfully created.
      5258e42d
    • Sam Lantinga's avatar
      Fixed tab spacing · ff12f1cf
      Sam Lantinga authored
      ff12f1cf
    • Sam Lantinga's avatar
      Fixed running on iPhone 3G · 45d3f30e
      Sam Lantinga authored
      45d3f30e
  4. 07 Jan, 2012 6 commits
    • Sam Lantinga's avatar
      Updated SDL test projects · c160c5c5
      Sam Lantinga authored
      c160c5c5
    • Sam Lantinga's avatar
    • Sam Lantinga's avatar
    • Sam Lantinga's avatar
      Use version B instead of A until we switch SDL 1.3 to SDL2 · 0de29d8f
      Sam Lantinga authored
      C.W. Betts 2012-01-06 22:58:41 PST
      I would NOT use A. SDL 1.2 uses A, and if I understand correctly, SDL 1.3 and
      SDL 1.2 are not binary compatible. Having a different link path for 1.2 and 1.3
      will solve any runtime linking errors that might occur.
      
      Sam Lantinga 2012-01-07 00:22:09 PST
      Good point.  Until we switch SDL 1.3 to SDL2, we shouldn't use the same link
      path.
      0de29d8f
    • Sam Lantinga's avatar
      Fixed bug 1256 - Invalid window warning in GL_CreateRenderer · 8bf062f3
      Sam Lantinga authored
      Martin Gerhardy 2011-07-27 02:26:06 PDT
      the window reference is lost in the GL_CreateRenderer function. The attached
      patch should fix this error.
      
      #0  SDLSystem_LogOutputFunction (userdata=0x63b010, category=1,
      priority=SDL_LOG_PRIORITY_ERROR, message=0x7fffffffcd00 "Invalid window") at
      src/system/sdl/SDLSystem.cpp:8
      #1  0x00007ffff7b1ddb3 in SDL_LogMessageV (category=1,
      priority=SDL_LOG_PRIORITY_ERROR, fmt=<value optimized out>, ap=<value optimized
      out>) at src/SDL_log.c:275
      #2  0x00007ffff7b1df7c in SDL_LogError (category=<value optimized out>,
      fmt=<value optimized out>) at src/SDL_log.c:212
      #3  0x00007ffff7b1d582 in SDL_SetError (fmt=0x7ffff7baaff0 "") at
      src/SDL_error.c:111
      #4  0x00007ffff7b96f9e in SDL_GL_MakeCurrent (window=0x0, ctx=0xa62ce0) at
      src/video/SDL_video.c:2484
      #5  0x00007ffff7b4ba0c in GL_ActivateRenderer (renderer=0xa8f680) at
      src/render/opengl/SDL_render_gl.c:195
      #6  0x00007ffff7b4c59a in GL_ResetState (window=0x918010, flags=<value
      optimized out>) at src/render/opengl/SDL_render_gl.c:214
      #7  GL_CreateRenderer (window=0x918010, flags=<value optimized out>) at
      src/render/opengl/SDL_render_gl.c:343
      #8  0x00007ffff7b48053 in SDL_CreateRenderer (window=0x918010, index=<value
      optimized out>, flags=2) at src/render/SDL_render.c:166
      8bf062f3
    • Sam Lantinga's avatar
      10b5183a
  5. 27 Jun, 2011 1 commit
    • Marco Trevisan (Treviño)'s avatar
      X11: Move to XSetWMProperties and add support to _NET_WM_PID · 8279896d
      Marco Trevisan (Treviño) authored
      Use the convenience function XSetWMProperties to set size, input
      and class hints, it also automatically sets the WM_CLIENT_MACHINE
      (this one needed by _NET_WM_PID) and WM_LOCALE_NAME windows hints.
      
      Plus we add support to the _NET_WM_PID atom which is needed by many
      windows managers to correctly associate a SDL window to its process
      and to related .desktop file and icon for the given host.
      8279896d
  6. 07 Jan, 2012 7 commits
    • Sam Lantinga's avatar
      Fixed bug 1224 - Blit map not updated if source palette changed · 0108ce22
      Sam Lantinga authored
      bastien.bouclet@gmail.com 2011-06-12 11:08:58 PDT
      
      SDL_LowerBlit doesn't update the blit color map if the source surface has
      changed.
      
      A proposed fix is attached, storing the source palette version in the color
      map.
      0108ce22
    • Sam Lantinga's avatar
      Fixed bug 1225 - Altivec blitters broken due to SDL_PixelFormat · f6bf8590
      Sam Lantinga authored
      bastien.bouclet@gmail.com 2011-06-13 05:50:58 PDT
      
      Static pixel format initialization has not been updated to reflect header
      changes in SDL_blit_N.c
      
      The attached patch fixes Altivec support for me. altivec.h is needed for some
      systems.
      f6bf8590
    • Sam Lantinga's avatar
      Fixed bug 1239 - Crash in iPad with iOS 3.2 because of missing contentScaleFactor support · de93e295
      Sam Lantinga authored
      Joseba García Echebarria 2011-06-30 19:03:56 PDT
      I just found that SDL is crashing in the iPad simulator for iOS 3.2 but not for
      iOS 4.2 or over when compiling with Xcode 4.0.2.
      The Xcode debugger points to line 127 in video/uikit/SDL_uikitopenglview.m as
      the line that triggers the crash.
      On those lines one can find:
      
              /* Use the main screen scale (for retina display support) */
              if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
                      self.contentScaleFactor = [UIScreen mainScreen].scale;
      
      I believe the problem to be that the "scale" selector is supported in iOS 3.2
      in the iPad, but contentScaleFactor is not.
      I'm no expert in Objective-C, but I believe the following code to be more
      correct (it doesn't crash for me):
              /* Use the main screen scale (for retina display support) */
              if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] &&
      [self respondsToSelector:@selector(contentScaleFactor)])
                      self.contentScaleFactor = [UIScreen mainScreen].scale;
      
      The same check is being performed in line 155 so I imagine it will crash there,
      too.
      
      Vittorio Giovara 2011-08-22 17:58:20 PDT
      
      yeah, -scale was introduced in 3.2 but made available only in 4.0, weird
      anyways we just need to check against contentScaleFactor as we can be sure that
      both are availble starting from 4.0
      
      the attached patch addresses this
      de93e295
    • Sam Lantinga's avatar
      Fixed bug 1344 - No OpenGL headers when compiling -> no working Software... · 3b5d79f4
      Sam Lantinga authored
      Fixed bug 1344 - No OpenGL headers when compiling -> no working Software renderer at runtime neither
      
      Make sure we have at least one render driver.
      3b5d79f4
    • Sam Lantinga's avatar
      Switched back to version A, since we don't actually have a version A for SDL 1.3. · 842e2046
      Sam Lantinga authored
      It would only be meaningful if we were planning to ship 1.2 as A, and 1.3 as B, which is completely worthless given the headers will be for 1.3 and the API is completely different.
      842e2046
    • Sam Lantinga's avatar
      Fixed bug 1362 - SDL Fails to compile with Visual C++ Express 2008 with Feb 2007 DirectX SDK · bc63cb4e
      Sam Lantinga authored
      Pallav Nawani 2012-01-04 00:48:29 PST
      Issue:
      Attempted to compile SDL as a static library.
      
      DirectX SDK: Feb 2007
      OS: Win 7
      Visual C++ Express 2008
      Compliation Mode: Static (Changed project settings from dll to lib)
      
      Error:
      C1021: invalid preprocessor command 'warning'
      
      It seems that the #warning directive does not exist in Vc++ Express 2008.
      bc63cb4e
    • Sam Lantinga's avatar
      The symbols should be private · 12c990f0
      Sam Lantinga authored
      12c990f0
  7. 06 Jan, 2012 1 commit
    • Sam Lantinga's avatar
      Updated iOS projects and renamed iPhoneOS to iOS · ec033a1d
      Sam Lantinga authored
      --HG--
      rename : README.iphoneos => README.iOS
      rename : Xcode-iPhoneOS/Demos/Default.png => Xcode-iOS/Demos/Default.png
      rename : Xcode-iPhoneOS/Demos/DemosiPhoneOS.xcodeproj/project.pbxproj => Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
      rename : Xcode-iPhoneOS/Demos/Icon.png => Xcode-iOS/Demos/Icon.png
      rename : Xcode-iPhoneOS/Demos/Info.plist => Xcode-iOS/Demos/Info.plist
      rename : Xcode-iPhoneOS/Demos/README => Xcode-iOS/Demos/README
      rename : Xcode-iPhoneOS/Demos/data/bitmapfont/kromasky_16x16.bmp => Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp
      rename : Xcode-iPhoneOS/Demos/data/bitmapfont/license.txt => Xcode-iOS/Demos/data/bitmapfont/license.txt
      rename : Xcode-iPhoneOS/Demos/data/drums/ds_brush_snare.wav => Xcode-iOS/Demos/data/drums/ds_brush_snare.wav
      rename : Xcode-iPhoneOS/Demos/data/drums/ds_china.wav => Xcode-iOS/Demos/data/drums/ds_china.wav
      rename : Xcode-iPhoneOS/Demos/data/drums/ds_kick_big_amb.wav => Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav
      rename : Xcode-iPhoneOS/Demos/data/drums/ds_loose_skin_mute.wav => Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav
      rename : Xcode-iPhoneOS/Demos/data/icon.bmp => Xcode-iOS/Demos/data/icon.bmp
      rename : Xcode-iPhoneOS/Demos/data/ship.bmp => Xcode-iOS/Demos/data/ship.bmp
      rename : Xcode-iPhoneOS/Demos/data/space.bmp => Xcode-iOS/Demos/data/space.bmp
      rename : Xcode-iPhoneOS/Demos/data/stroke.bmp => Xcode-iOS/Demos/data/stroke.bmp
      rename : Xcode-iPhoneOS/Demos/src/accelerometer.c => Xcode-iOS/Demos/src/accelerometer.c
      rename : Xcode-iPhoneOS/Demos/src/common.c => Xcode-iOS/Demos/src/common.c
      rename : Xcode-iPhoneOS/Demos/src/common.h => Xcode-iOS/Demos/src/common.h
      rename : Xcode-iPhoneOS/Demos/src/fireworks.c => Xcode-iOS/Demos/src/fireworks.c
      rename : Xcode-iPhoneOS/Demos/src/happy.c => Xcode-iOS/Demos/src/happy.c
      rename : Xcode-iPhoneOS/Demos/src/keyboard.c => Xcode-iOS/Demos/src/keyboard.c
      rename : Xcode-iPhoneOS/Demos/src/mixer.c => Xcode-iOS/Demos/src/mixer.c
      rename : Xcode-iPhoneOS/Demos/src/rectangles.c => Xcode-iOS/Demos/src/rectangles.c
      rename : Xcode-iPhoneOS/Demos/src/touch.c => Xcode-iOS/Demos/src/touch.c
      rename : Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj => Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
      rename : Xcode-iPhoneOS/SDL/testsdl-Info.plist => Xcode-iOS/SDL/testsdl-Info.plist
      rename : Xcode-iPhoneOS/Template/SDL iOS Application/Default.png => Xcode-iOS/Template/SDL iOS Application/Default.png
      rename : Xcode-iPhoneOS/Template/SDL iOS Application/Icon.png => Xcode-iOS/Template/SDL iOS Application/Icon.png
      rename : Xcode-iPhoneOS/Template/SDL iOS Application/Info.plist => Xcode-iOS/Template/SDL iOS Application/Info.plist
      rename : Xcode-iPhoneOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns => Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
      rename : Xcode-iPhoneOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist => Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
      rename : Xcode-iPhoneOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj => Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj
      rename : Xcode-iPhoneOS/Template/SDL iOS Application/main.c => Xcode-iOS/Template/SDL iOS Application/main.c
      rename : Xcode-iPhoneOS/Test/Info.plist => Xcode-iOS/Test/Info.plist
      rename : Xcode-iPhoneOS/Test/README => Xcode-iOS/Test/README
      rename : Xcode-iPhoneOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj => Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
      ec033a1d
  8. 03 Jan, 2012 1 commit
  9. 02 Jan, 2012 2 commits
  10. 01 Jan, 2012 1 commit
  11. 31 Dec, 2011 3 commits
  12. 30 Dec, 2011 2 commits