bilsch01 | 5 Mar 00:25 2015
Picon
Picon

getting out of continuous loop

I thought this code would exit the loop when up arrow is pressed - but it does not. What am I doing wrong? TIA. Bill S.

#include
#include
#include

int main()
{
SDL_Init(SDL_INIT_EVERYTHING);

const Uint8 *state = SDL_GetKeyboardState(NULL);
while (!(state[SDL_SCANCODE_UP]))
{
printf("just burning time in a loop \n");
}
printf(" is pressed.\n");
SDL_Quit();
}
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
mbabuskov | 4 Mar 20:44 2015
Picon

Re: SDL_RenderCopy scaling artifacts








tjpalmer wrote:
However, as I somewhat feared (though I still wanted to try it), this won't help


Won't or didn't?

I using this for my game and it works fine. Perhaps there's something wrong with alpha channel on your image or something like that (for example I discovered that some graphics programs create files with unexpected extra data in the alpha channel that can messup the way it looks on screen). How are you loading image, is it from PNG file? Does to problem also show up when you load from BMP or JPG?

If the problem is not visible in BMP/JPG then try fixing the PNG image. I recall have similar issues and just added a completely black layer behind the graphics, re-exported with Gimp and everything was fine afterwards. Also check if background color is saved in PNG.

Could you post the original image file that shows artifacts when scaled?



bigosaur.com
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
mbabuskov | 4 Mar 09:59 2015
Picon

Re: SDL_RenderCopy scaling artifacts








tjpalmer wrote:
I've tried setting hints, to no effect. Any recommendations?


Are you sure you set hints before texture was created? Which hints did you try? Linear, nearest?



bigosaur.com
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
bilsch01 | 4 Mar 01:02 2015
Picon
Picon

simple program with errors

I am new to SDL and C++. Can someone here explain why I get these errors?

#include
#include

int main()
{
if (SDL_Init(SDL_INIT_VIDEO) != 0){
std::cout return 1;
}

SDL_Quit();
}

shorthello.cpp:7:2: error: ‘cout’ is not a member of ‘std’
std::cout ^
shorthello.cpp:7:55: error: ‘endl’ is not a member of ‘std’
std::cout ^
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Sparks | 3 Mar 18:33 2015
Picon

Re: Problem with static SDL2








Alexey Petruchik wrote:
I know that it is not intended way to use SDL but other people pressure me
So... I've built debug static version of SDL2 linked to static runtime (/MTd) using Visual Studio 2013.
When I link my app to SDL2.lib I get this error message:


LIBCMTD.lib(fpinit.obj) : error LNK2005: __fltused already defined in SDL2.lib(SDL_stdlib.obj)



Using /NODEFAULTLIB ends up in having tons of unresolved externals to functions like fopen, fclose, memcpy etc. Can someone explain to me what went wrong I how I can fix that?


Regards, Alexey

Why are you doing /NODEFAULTLIB? You need the default libs so that it can link in all the functions it needs.
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
^DJ_Link^ | 3 Mar 13:55 2015
Picon

GamePad being detected twice when using SDL_INIT_HAPTIC

Ok, I'm having a weird issue, using SDL 2.0.3 on Mac OS X 10.10

I'm using a Xbox 360 controller. All buttons work fine, it detects connect/disconnect without problems. Yesterday I decided to implement the vibration so I
added SDL_INIT_HAPTIC too.








Code:

SDL_Init(SDL_INIT_VIDEO|SDL_INIT_GAMECONTROLLER|SDL_INIT_HAPTIC)


The problem is that now the event SDL_CONTROLLERDEVICEADDED is being triggered twice when I plug the controller. When I remove SDL_INIT_HAPTIC it only gets called once, but vibration won't work.
Is this a known issue or may I be doing something wrong?



<at> DJ_Link

www.david-amador.com
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Francisco Sant'anna | 3 Mar 01:50 2015
Picon

Fwd: GSoC LabLua'15: SDL + Céu

Hello,

(Hope this kind of e-mail is allowed on the list.)

As an accepted organisation for the Google Sumer of Code (GSoC), LabLua is seeking students interested in working with SDL-based games using the programming language Céu.

# About LabLua:

LabLua is a research lab at PUC-Rio dedicated to programming languages:

This is our second year participating in GSoC:
https://www.google-melange.com/gsoc/org2/google/gsoc2015/lablua

Last year we had 4 students working with us:
https://www.google-melange.com/gsoc/org2/google/gsoc2014/lablua


# About Céu:

Besides Lua, LabLua also does research on the language Céu, which targets system-level development of reactive systems.
For a little introduction about the language, please watch the video in our front page:
http://ceu-lang.org/

Céu appeared last year on "StrangeLoop" and the "Future Programming Workshop":
# About the Project:

Suggestions are welcome (also from list members not necessarily applying to GSoC).

= Idea 1:

Port to Céu an existing C++ open source game of considerable size (30-50k lines of code).

Here are some possible projects to look for:
http://en.wikipedia.org/wiki/List_of_open-source_video_games
http://www.reddit.com/r/opensourcegames

In addition to a working implementation, we expect the student to write about the experience of using Céu in the context of game development, also comparing the implementations in terms of code complexity (e.g., lines of code), resource usage (CPU, memory), etc.


# How to apply:

= Required knowledge:
  - SDL
  - C
(Previous experience with Céu is of course not required.)
  - Linux, Mac or Windows?
The current distribution of Céu is only available for Linux.
A student using another operating system is also welcome, as long as she/he has the skills to build the development environment by her/himself.
The compiler of Céu depends on gcc, lua-5.1, and lua-lpeg.

= Recommendations before applying:

Last year LabLua had over 15 submissions for only 4 slots.
(Note that we will only know the number of slots for this year *after* the students submit the proposals.)

It is highly recommended that the student installs Céu, compiles some examples, possibly making something very simple from scratch (or changing some existing example).
For us, this is important to see if the student will be able to keep track of the project.
For the student, this initial experience is important to ensure that the expectations with the project match the reality.

If the student has participated in other open source projects, it is also recommended that she/he tell us about that experience.


# Questions?

We will be happy to answer.

Thanks,
Francisco Sant'Anna (LabLua)

_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
JeZ-l-Lee | 2 Mar 17:06 2015
Picon

[2.0]-Clear Mouse Button Down Events At App Start?

[2.0]-Clear Mouse Button Down Events At App Start?

Hi,

I have a weird issue with SDL 2.0.3 on Microsoft Windows 8.1 Pro 64Bit.
When the SDL2 game first starts it registers a mouse button down event which I want to fix.
How can I clear all mouse button down events at application start in SDL2?

Thanks!



JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alvin Beach | 1 Mar 19:35 2015
Picon

Small assets on high resolution SDL_Window

Hello all,

I've noticed that on high resolution displays (e.g. Dell XPS13 laptop and Samsung Galaxy Tab PRO)
that my assets (e.g. icons, images, text, etc.) render very small. I'm just curious what others do
in these situations? I've poked around in the SDL wiki, Google and, in the case of Android, the
Android source in SDL2, but haven't found a clear way to manage this.

For instance, the Tab PRO has a resolution of 2560x1600 and all my widgets images (via SDL_image)
and text (via SDL_ttf) are extremely tiny. On the Dell XPS13, the effect wasn't too bad, so I just
increased the font size as the images weren't too small.

Is SDL_RenderSetLogicalSize() the way to handle this? If so, do you just call
SDL_RenderSetLogicalSize() when the actual SDL_Window is "too large"?

Or, in the case on Android, is there some magical setting in AndroidManifest.xml that I could use to
"normalise" the SDL_Window across devices?

Correct me if I am wrong, but I'm thinking that this is an issue with the monitor/display rather
than with the platform. I would prefer a solution that would work on both the Dell XPS13 and
Android. But, maybe that isn't possible?

Many thanks.

Cheers,

Alvin
Sparks | 1 Mar 18:54 2015
Picon

SDL 2.0.3 vs git/hg HEAD colors are much darker?


Can anyone explain this?

Top one is using SDL git mirror repo.
Bottom one is using SDL 2.0.3.
This is run on the same machine, windows 7.

I don't see any commits that have to do with color/brightness/gamma from the release of 2.0.3 to hg/git HEAD of b577c4753421, so, what could explain why 2.0.3 is so much darker than the git/hg repo?
_______________________________________________
SDL mailing list
SDL <at> lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Devesh Sawant | 1 Mar 12:53 2015
Picon

[REPLY]-->[dfrizel] SDL2 does not initialize at all and throws a SIGSEGV stoppin

The initialisation code is this:
""
int init(SDL_Renderer * gRenderer, SDL_Window * gWindow)
{
  int success= 1;
  
  if ( SDL_Init(SDL_INIT_VIDEO) < 0   )
  {
    printf(" SDL could not initialise! SDl_Error : %s\n",SDL_GetError());
    success = 0; 
  }
  else
  {
    gWindow = SDL_CreateWindow("NIBBLES>>>0",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,SCREEN_WIDTH,SCREEN_HEIGHT,SDL_WINDOW_SHOWN);
    if ( gWindow == NULL)
    {
      printf("Window could not be created! SDL_Error: %s\n",SDL_GetError());
      success = 0;
    }
    else
    {
      gRenderer  = SDL_CreateRenderer(gWindow,-1,SDL_RENDERER_SOFTWARE);
      if (gRenderer  == NULL )
      {
success = 0;
printf("Renderer could not be created! SDL_Error: %s\n",SDL_GetError());
      }
    }
  }
  return success;
}

""
My OS
""
Linux crunchbang 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
""
When SDL tries to run some functions during the execution of the game, the required source file is not found.
These src files:
getenv.c, pthread_key_create.c, pthread_getspecific.c, clock_gettime.c, malloc.c, pthread_mutex_init.c, forward.c, pthread_mutex_lock.c, sigaction.c,
and others also.


Backtrace ( when malloc.c :file not found )
#0  _int_malloc (av=0x7ffff78b5e40, bytes=40) at malloc.c:4317
#1  0x00007ffff75a9012 in __libc_calloc (n=<optimized out>, elem_size=<optimized out>) at malloc.c:4094
#2  0x00007ffff7b9e754 in SDL_CreateMutex_REAL () at /home/devesh/downloads/SDL2-2.0.3/src/thread/pthread/SDL_sysmutex.c:50
#3  0x00007ffff7b0ede5 in SDL_StartEventLoop () at /home/devesh/downloads/SDL2-2.0.3/src/events/SDL_events.c:175
#4  0x00007ffff7ad8825 in SDL_InitSubSystem_REAL (flags=16416) at /home/devesh/downloads/SDL2-2.0.3/src/SDL.c:144
#5  0x0000000000401a01 in init (gRenderer=0x0, gWindow=0x0) at src/nibbles.c:244
#6  0x0000000000401caf in main () at src/nibbles.c:346

At "line 173: if (SDL_VideoInit(NULL) < 0) { "
Backtrace:
#0  SDL_InitSubSystem_REAL (flags=16416) at /home/devesh/downloads/SDL2-2.0.3/src/SDL.c:173
#1  0x0000000000401a01 in init (gRenderer=0x0, gWindow=0x0) at src/nibbles.c:244
#2  0x0000000000401caf in main () at src/nibbles.c:346

I think it's not initialising because none of the files are found .

Then comes --> Cannot find bounds of current function 

Backtrace
#0  0x00007ffff7de1e22 in ?? () from /lib64/ld-linux-x86-64.so.2
#1  0x00007ffff7de4bd6 in ?? () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7dea212 in ?? () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7deabd6 in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff7de92dc in ?? () from /lib64/ld-linux-x86-64.so.2
#5  0x00007ffff7def168 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff7deabd6 in ?? () from /lib64/ld-linux-x86-64.so.2
#7  0x00007ffff7deeb4a in ?? () from /lib64/ld-linux-x86-64.so.2
#8  0x00007ffff70a9f66 in dlopen_doit (a=<optimized out>) at dlopen.c:67
#9  0x00007ffff7deabd6 in ?? () from /lib64/ld-linux-x86-64.so.2
#10 0x00007ffff70aa2ec in _dlerror_run (operate=0x7ffff70a9f00 <dlopen_doit>, args=0x7fffffffd880) at dlerror.c:164
#11 0x00007ffff70a9ee1 in __dlopen (file=<optimized out>, file <at> entry=0x7ffff7bae428 "libX11.so.6", mode=<optimized out>, mode <at> entry=2) at dlopen.c:88
#12 0x00007ffff7b8215b in SDL_LoadObject_REAL (sofile=0x7ffff7bae428 "libX11.so.6") at /home/devesh/downloads/SDL2-2.0.3/src/loadso/dlopen/SDL_sysloadso.c:36
#13 0x00007ffff7b859f1 in SDL_X11_LoadSymbols () at /home/devesh/downloads/SDL2-2.0.3/src/video/x11/SDL_x11dyn.c:175
#14 0x00007ffff7b97c76 in X11_Available () at /home/devesh/downloads/SDL2-2.0.3/src/video/x11/SDL_x11video.c:309
#15 0x00007ffff7b809a1 in SDL_VideoInit_REAL (driver_name=<optimized out>, driver_name <at> entry=0x0) at /home/devesh/downloads/SDL2-2.0.3/src/video/SDL_video.c:466
#16 0x00007ffff7ad886f in SDL_InitSubSystem_REAL (flags=16416) at /home/devesh/downloads/SDL2-2.0.3/src/SDL.c:173
#17 0x0000000000401a01 in init (gRenderer=0x0, gWindow=0x0) at src/nibbles.c:244
#18 0x0000000000401caf in main () at src/nibbles.c:346

I ran gdb again  and next'd to the point where the segfault signal is received.

'''
 if ( SDL_Init(SDL_INIT_VIDEO) < 0   )
(gdb) 

Program received signal SIGSEGV, Segmentation fault.

0x00007ffff7b227cd in SDL_DestroyRenderer_REAL (renderer=0x7) at /home/devesh/downloads/SDL2-2.0.3/src/render/SDL_render.c:1841
1841    CHECK_RENDERER_MAGIC(renderer, );

(gdb) bt

#0  0x00007ffff7b227cd in SDL_DestroyRenderer_REAL (renderer=0x7) at /home/devesh/downloads/SDL2-2.0.3/src/render/SDL_render.c:1841
#1  0x0000000000401ad8 in close (gRenderer=0x7, gWindow=0x2) at src/nibbles.c:272
#2  0x00007ffff607bdde in xcb_disconnect () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007ffff62b3027 in XCloseDisplay () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#4  0x00007ffff7b97c9f in X11_Available () at /home/devesh/downloads/SDL2-2.0.3/src/video/x11/SDL_x11video.c:312
#5  0x00007ffff7b809a1 in SDL_VideoInit_REAL (driver_name=<optimized out>, driver_name <at> entry=0x0) at /home/devesh/downloads/SDL2-2.0.3/src/video/SDL_video.c:466
#6  0x00007ffff7ad886f in SDL_InitSubSystem_REAL (flags=16416) at /home/devesh/downloads/SDL2-2.0.3/src/SDL.c:173
#7  0x0000000000401a01 in init (gRenderer=0x0, gWindow=0x0) at src/nibbles.c:244
#8  0x0000000000401caf in main () at src/nibbles.c:346

'''
Hmmm. 

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

Gmane