pik33 | 11 Feb 09:28 2016
Picon

Re: SDL_UpdateTexture crash when called from another thread...

Solved.

The solution was simple: moving sdl_init, sdl_quit and all the rest of SDL initialization stuff from the main therad to the screen refreshing thread. Now all SDL calls are called from the same thread and it works with OpenGL renderer too.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
techtonik | 11 Feb 08:51 2016
Picon
Gravatar

Re: Two renderers for the same window

Sorry. Missed my notification. I guess I wanted to do some pixel graphics in some separate renderer, because those 3D renderers were slow.

But perhaps the question comes from misunderstanding why SDL2 allow to create multiple renderer at all if you can only have one window?

Why have separate step for creating renderer?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
techtonik | 11 Feb 08:40 2016
Picon
Gravatar

Expired SSL certificate

Chrome doesn't accept SHA-1 certificates anymore.

[img]http://i.imgur.com/ocKAlJK.png?1[/img]
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
AntTheAlchemist | 9 Feb 12:55 2016
Picon

Re: Android Native Activity

Has any more progress been made with this?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
LBandy | 9 Feb 10:21 2016
Picon
Gravatar

SDL_SetSurfaceColorMod() and transparency issues

Hello,

I'm having an issue trying to figure out how to apply SDL_SetSurfaceColorMod() when blitting transparent surfaces. Here's what I'm doing:








Code:
SDL_Surface* backgroundSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000);
SDL_SetSurfaceBlendMode(backgroundSurface, SDL_BLENDMODE_NONE);
SDL_Surface* baseSurface = IMG_Load("base.png");
SDL_Surface* hairSurface = IMG_Load("hair.png");
SDL_SetSurfaceColorMod(hairSurface, 100, 100, 100);
SDL_BlitSurface(baseSurface, NULL, backgroundSurface, NULL);
SDL_BlitSurface(hairSurface, NULL, backgroundSurface, NULL);
IMG_SavePNG(backgroundSurface, "pic.png");




The first image is how the surface is being saved without SDL_SetSurfaceColorMod() being called.
The second image is how the surface is being saved after SDL_SetSurfaceColorMod() has been called.
The third image is how the surface is then converted to a Texture and being rendered on screen.

If I omit the SDL_SetSurfaceBlendMode() even the rendered texture looks the same as the second saved image.

Any ideas what am I doing wrong?

Thank you for your help!



ePic Character Generator - endless character stream in your games using SDL 2.0:
http://www.epicgenerator.net
http://store.steampowered.com/app/408930
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
LBandy | 8 Feb 10:20 2016
Picon
Gravatar

SDL_RenderReadPixels crash on reading from Texture

Hello,

I've been trying to turn back a Texture to a Surface. Here's my code:








Code:

SDL_Surface* surface = IMG_Load("picture.png");
SDL_Texture* texture = SDL_CreateTextureFromSurface(m_MainRenderer, surface);
SDL_Surface* newSurface = SDL_CreateRGBSurface(0, surface->w, surface->h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);

SDL_SetRenderTarget(m_MainRenderer, texture);
SDL_RenderReadPixels(m_MainRenderer, NULL, newSurface->format->format, newSurface->pixels, newSurface->pitch);
SDL_SetRenderTarget(m_MainRenderer, NULL);


It always crashes on different places, but the callstack is usually similar to:








Code:

_SDL_Blit_Slow()   Unknown
_SDL_CalculateBlit()   Unknown
_SDL_LowerBlit_REAL()   Unknown
_SDL_ConvertPixels_REAL()   Unknown
_SDL_AtomicUnlock_REAL()   Unknown
_SDL_RenderReadPixels_REAL()   Unknown
_SDL_RenderReadPixels()   Unknown


If I don't switch RenderTarget, I'm able to capture what is on the Renderer to a surface, but that's not what I want to do. The renderer is created with the flag SDL_RENDERER_TARGETTEXTURE and I've tried setting the texture to SDL_TEXTUREACCESS_TARGET, but it didn't help.

Any ideas what am I doing wrong here?

Thank you for your help!



ePic Character Generator - endless character stream in your games using SDL 2.0:
http://www.epicgenerator.net
http://store.steampowered.com/app/408930
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Stephen Anthony | 7 Feb 21:14 2016
Picon

Deadzone in analog input at center using SDL2 (Linux)

I'm testing an adaptor that converts from Atari 2600 paddle controllers 
to USB analog values (www.2600-daptor.com).  The input is being received 
in Stella (Atari 2600 emulator) in the range -32768 to 32767, as 
expected.  Problem is, there's a deadzone in the center, at position 0, 
where there's no input for a few moments.

I've also tested this with 'testjoystick' from SDL2, and it confirms the 
dead spot.  Also, in SDL1 using the old joystick API, the dead spot 
isn't there.  Finally, when testing with 'evtest', the problem isn't 
there either.

From my testing, it seems that event input is working correctly, just 
not in SDL2.  Also, this happening only in Linux.  The controller is 
working fine in Windows and OSX.

Can anyone offer some advice on this??

Thanks,
Steve A.
Stella maintainer
qzole | 6 Feb 22:50 2016
Picon

Re: SDL2 + CMake + Android (on Windows)

This question is relevant for me too right now.
If I figure out from all the sources out there, I'll post my solution here
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Parikshit Singh | 6 Feb 14:28 2016
Picon
Gravatar

How to mark certain pixels as Alpha (Erase Pixels)

I want to erase pixels , mark them as alpha. I have tried the following 
code.
Uint32 *pixels = (Uint32 *)surface->pixels;
pixels[20 * surface->w + 20] = SDL_MapRGBA(surface->format,255,255,255,0);
surface->pixels = pixels;

Though , 20x20 is still not alpha , I have tried it with 
SDL_MapRGBA(surface->format,0,0,0,255) and it paints the pixels as black.
pik33 | 3 Feb 11:48 2016
Picon

Re: Renderer freeze when lock screen and login again

The same problem here. The program stops rendering when Windows UAC blanks the screen and aks if I really want to blah blah.. After this the program no longer works.

The workaround was to do this when SDL_WINDOWEVENT_ENTER








Code:


    SDL_DestroyTexture( sdlTexture );
    SDL_DestroyRenderer( sdlRenderer );
    sdlRenderer := SDL_CreateRenderer(scr, -1, 0);
    sdlTexture := SDL_CreateTexture(sdlRenderer,SDL_PIXELFORMAT_ARGB8888,SDL_TEXTUREACCESS_STreaming,1792,1120);
    SDL_RenderSetLogicalSize(sdlRenderer,1792,1120);



Now it works but sometimes crashes with segmentation fault. The SDL_RENDER_DEVICE_RESET is never triggered.

I lowered UAC settings, so the screen doesn't go dim anymore, but this is not a solution.

When the SDL_RENDER_DEVICE_RESET is triggered? How to use it? How to avoid situation described above?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
mbabuskov | 3 Feb 09:37 2016
Picon
Gravatar

Setting up VSYNC with SDL_CreateWindowAndRenderer

Hello,

I'm running my game full screen using the desktop resolution with SDL_CreateWindowAndRenderer. This all works fine.

I would like to add a VSYNC option, so that the players can turn it on if they desire. However, the docs for SDL_CreateWindowAndRenderer show that only Window flags can be supplied.

How can I create a fullscreen game with VSYNC turned on?

Thanks.



bigosaur.com
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Gmane