perfectASD | 22 May 2013 21:24
Picon

SDL_image and texture access

Hi there! I'd like to know if there's a way to open an image with the SDL_image functions and then set the texture access mode to SDL_TEXTUREACCESS_STREAMING.
Thank you!
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Anthony Walter | 23 May 2013 09:25
Picon
Gravatar

ANN: New library released based on SDL 2.0

I've been working on this project for more than a month and against my better judgement I'm posting a link. I thought maybe this long holiday weekend some people somewhere might look at it and give me some feedback (watch the video):

http://www.baregame.org/

Hint: It's a class library written around SDL 2.0 and optionally includes a compiler+IDE as well as recent binaries of SDL 2.0 for 32/64 bit Windows an Linux.

If you look at the site, please bear in mind i haven't had time to write up everything yet. Let me know what you think.

_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Mako_energy | 23 May 2013 00:33
Picon
Favicon

Link error on MacOSX

I am currently trying to do all the necessary touchups to my engine so I can get a working MacOSX port up and running. I have SDL being built through CMake which is integrated into the CMake configuration of my engine. SDL compiles just fine as a dependency, however when it attempts to link it errors in "SDL_Log.c" saying it can't find the symbol "_SDL_NSLog". I have looked through the code and I found the method it's talking about in "SDL_cocoavideo.m". As far as I can tell the project seems to be configured correctly for that files inclusion in the project.

What could be going wrong?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
José Luis Pereira | 22 May 2013 23:45
Picon

Android EGL-fu

Hello guys,

Is there any particular reason to use all EGL-related calls with JNI? I've dug a little bit on the AOSP code, and realized that all java egl related classes are merely a JNI wrapper to the proper EGL C library.
This means that when SDL is p.e. flipping buffers, it will go from C to Java to C again.

So, I moved all EGL-related SDLActivity methods to C-code only (SDL_androidgl.c), as AFAIK all supported versions shall support the egl.h on NDK. 

Minimum API is 10 right? (from what i could see on the android-project AndroidManifest.xml)

P.E, Android_GL_SwapWindow can be simply implemented by:
void
Android_GL_SwapWindow(_THIS, SDL_Window * window)
{
   if (eglSwapBuffers(display, surface) == EGL_FALSE) {
        SDL_SetError("Error on eglSwapBuffers");
        return;
    }
}

SDLActivity methods:
initEGL - createEGLContext - createEGLSurface - flipEGL

I did not benchmark it but i'm pretty sure it is more efficient as we remove the JNI context switching overhead.
The only JNI call we will need is to update the native EGL surface, which is recovered using ANativeWindow_fromSurface.

Is there interest on this improvement? I want to make sure it doesnt break any feature before committing it to review.

Cheers
------
José Pereira

_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
郭永磊 | 22 May 2013 09:00
Favicon

problem about oss audio driver

#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>

#include "SDL.h"
#include "SDL_mixer.h"

int main(int argc, char **argv)
{
    //parse cmd para
    if(argc != 2){
        fprintf(stderr, "%s filename.\n", argv[0]);
        exit(-1);
    }

    //init SDL
    if(SDL_Init(SDL_INIT_AUDIO) == -1){
        fprintf(stderr, "sdl init:%s\n", Mix_GetError());
        exit(-1);
    }
    atexit(SDL_Quit);

    //check audio driver name
    char buffer[32];
    fprintf(stderr, "audio driver:%s\n", SDL_AudioDriverName(buffer, 32));

    //init SDL_mixer
    if(Mix_OpenAudio(44100, AUDIO_S16LSB, 1,  4096) == -1){
        fprintf(stderr, "open audio error:%s\n", Mix_GetError());
        exit(-1);
    }

    // load music file
    Mix_Music *music;
    music=Mix_LoadMUS(argv[1]);
    if(!music){
        printf("Mix_LoadMUS: %s\n", Mix_GetError());
        return 0;
    }

    // play music, 2+1 times.
    if(Mix_PlayMusic(music, 0)==-1){
        printf("Mix_PlayMusic: %s\n", Mix_GetError());
    }

    //check if playing, print log
    if(Mix_PlayingMusic()){
        printf("music is playing...\n");
    }

    //wait until the music over, do nothing, just wait.
    while(Mix_PlayingMusic()){
        //
    }

    //now, music is over
    printf("music play over,exiting\n");

    //cleanup
    Mix_FreeMusic(music);
    Mix_CloseAudio();

    return 0;
}

this is my music player src, when the player runs on PC,all OK;
but,on my board(Linux OS, OSS audio driver),plays only a while, the player app will exit.
I have no ideal about it.
cat test.wav > /dev/dsp works well;so the oss driver is no problem.
test.wav is below:
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 22050 Hz




--
郭永磊
地址:海淀区中关村
电话:15909866103
手机:15909866103

_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Brian Barnes | 22 May 2013 06:31
Favicon

Re: SDL2 iOS Callbacks + Ray Tracer

Sam wrote:

> Can you report that as a bug to bugzilla?
> http://bugzilla.libsdl.org/

Sorry, I always forget that step.  I've added 2 bugs:

1860 - Relate mouse movement on OS X doesn't hide cursor
1861 - Relate mouse movement on windows jumps the cursor to the center on the first mouse click (1836 is a
similar report for OS X, but I don't see the bug there, it's possible the way I'm handling some additional
things in OS X mitigates that for me.)

Can somebody quickly explain whatever change happened that automatically handles iOS landscape
rotation?  Is it during the texture transfer?  I'm wondering what parts of my code I need to deal with, and if
this is the final version of how that code will function for SDL 2.x.

[>] Brian
Fuentes | 20 May 2013 02:49
Picon

Re: SDL2-widgets, toolkit using SDL2, now hardware accellerated

Any chance to get a Windows port of this great lib?
AFAIK SDL-widgets is the most functional, most maintained and most refined SDL GUI library out there, but only works in Linux (or *nix like?).

So... You have any plans, or any intention to support the windows os?

Many thxs in advance.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
D B | 21 May 2013 17:13
Picon

syntax error before NSColor

Hi,

I like to compile SDL2 for 10.4 i386 and ppc.  I've had little problem in the past, but as of rev 373d9e4e8ad9, I get a weird compile error:

syntax error before NSColor

Removing the change made in that revision fixes compiling.  I do not know why it is throwing a compile error as NSColor has been around forever.  I thought it might be a weird line ending problem, but that wasn't it either.

Just FYI
D
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
LBandy | 21 May 2013 08:23
Picon
Gravatar

How to force a size to a surface/texture?

I've created an empty surface, then blitted some other surfaces to is. When I convert it to SDL_Texture, the empty space is discarded, so it appeares scaled when rendered. How can I fix this, how could I render the empty space as well?



Runic Girls - a hexa match3 game with girls created using SDL 2.0:
http://www.facebook.com/RunicGirls

Gameplay trailer:
http://www.youtube.com/watch?v=yMGdfNHGhIU&hd=1
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Constantin Berhard | 21 May 2013 01:17
Picon
Favicon

add gamecontroller

Is it correct, that you are currently collecting game controller mapping
strings to include for shipping with SDL2?

I have created a string for my game controller, a Saitek P2500 Rumble.
SDL_GameControllerAddMapping ( "03000000a30600000cff000010010000,Saitek
PLC Cyborg Force Rumble
Pad,a:b2,b:b3,x:b0,y:b1,back:b10,guide:b4,start:b5,leftshoulder:b6,rightshoulder:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a3,righty:a2,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2");

Is that information sufficient? I have seen in SDL_gamecontroller.c that
the integrated strings are somewhat different depending on the OS. This
string is generated on Xubuntu 12.10 AMD64.
Constantin Berhard | 20 May 2013 22:39
Picon
Favicon

Re: checkkeys - key not recognized

On 2013-05-20 21:05, sdl-request <at> lists.libsdl.org wrote:
Does it even have a key code there? It says 0 if I'm reading correctly o_O
Yes. When I do the same actions in xev, the following comes up:

KeyPress event, serial 37, synthetic NO, window 0x5000001,
    root 0xad, subw 0x5000002, time 27671363, (42,40), root:(593,373),
    state 0x0, keycode 21 (keysym 0xfe51, dead_acute), same_screen YES,
    XLookupString gives 2 bytes: (c2 b4) "´"
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: True

KeyRelease event, serial 37, synthetic NO, window 0x5000001,
    root 0xad, subw 0x5000002, time 27671436, (42,40), root:(593,373),
    state 0x0, keycode 21 (keysym 0xfe51, dead_acute), same_screen YES,
    XLookupString gives 2 bytes: (c2 b4) "´"
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x5000001,
    root 0xad, subw 0x5000002, time 27672463, (42,40), root:(593,373),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XmbLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: True

KeyPress event, serial 37, synthetic NO, window 0x5000001,
    root 0xad, subw 0x5000002, time 27672463, (42,40), root:(593,373),
    state 0x0, keycode 0 (keysym 0xe9, eacute), same_screen YES, // KEYCODE ACTUALLY 0
    XLookupString gives 0 bytes:
    XmbLookupString gives 2 bytes: (c3 a9) "é" // NOTE THE ACCENT HERE
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x5000001,
    root 0xad, subw 0x5000002, time 27672574, (42,40), root:(593,373),
    state 0x0, keycode 26 (keysym 0x65, e), same_screen YES,
    XLookupString gives 1 bytes: (65) "e"
    XFilterEvent returns: False

Maybe the keycode is 0 because there is no single key for that letter on the keyboard.

Also, if I comment the call to "SDL_StartTextInput()" out, there is still no event for the first key press. So there is no chance of using that key for a game.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Gmane