shu | 1 Apr 01:19 2005
Picon

Re: Mouse events and Threads...any suggestions?

Quoting Stephane Marchesin <stephane.marchesin <at> wanadoo.fr>:

> shu wrote:
>
> >I am making a client/server program, and the clients will be using SDL to
> play
> >short movie clips (the clip is decided by the server and broadcast to the
> >clients) and subsequently changes to one client will affect the video play
> on
> >other clients (this is for an art project...).
> >
> >The client needs to be able to take mouse input (SDL MouseButtonEvent) while
> the
> >movie is playing and do the following:
> >A) interrupt the movie clip and play a different movie upon mouse input
> >B) send the mouse input information to the server
> >
> >I am new to SDL and threading but my suspicion is that the SDL movie playing
> is
> >already on its own thread (correct?).
> >
> SDL by itself doesn't play movies. What are you using to play these movies ?
>
> Stephane
>
>
>
>
> _______________________________________________
> SDL mailing list
(Continue reading)

David Olofson | 1 Apr 01:45 2005
Picon

Re: SDL/OpenGL and Portability

On Thursday 31 March 2005 22.53, Steaphan Greene wrote:
> On Thu, Mar 31, 2005 at 10:11:14PM +0200, David Olofson wrote:
> 
> > Well, I used to do that before, and I have GNU Autoconf scripts to 
> > take care of the details of linking - statically or dynamically - 
> > with OpenGL.
> 
> Yeah, I was hoping to avoid this.  The addition of --libs-gl and
> --libs-glu to sdl-config would solve the problem for my class needs.

Yeah, might be handy. I don't really care much for Autotools, BTW... 
It's huge, messy, slow and doesn't really do the job too well anyway. 
It seems to be the de-facto standard, and I've done a few projects 
with it now; that's probably the main reasons why I'm still using it.

> > However, the problem is that dynamic linking means the application 
> > won't even load if there's no OpenGL lib. (That's why there are
> > two  
> > binaries in current (old) Kobo Deluxe Win32 packages; the one with 
> > OpenGL support won't even load without an opengl32.dll.)
> 
> Right, but it's not big deal to simply state that the game requires
> opengl installed and setup.  Most of the games would be completely
> unplayable with software emulation anyway.

Right; Kobo Deluxe and other 2D games using OpenGL, that are still 
actually playable without OpenGL, are a bit of a special case.

Either way, the reason I included the non-OpenGL exe was that some 
Windows machines I tested on plain didn't have any traces of OpenGL 
(Continue reading)

E. Wing | 1 Apr 05:43 2005
Picon

Re: SDL/OpenGL and Portability

> From: Steaphan Greene
>
> I am currently teaching an undergraduate course on free game
> development.  I wanted all the projects to be totally portable, so I
> chose SDL/OpenGL to be the target platform.  There have been a few
> "hiccups", but only one major problem.  While sdl-config can make sure a
> single makefile can compile SDL apps on any of the platforms we use, and
> SDL_opengl.h makes the code able to be completely portable, it does
> nothing to help with linking the OpenGL libraries.  In most systems this
> would be -lGL and -lGLU, but in Windows this is -lopengl32 and -lglu32,
> while in MacOS-X this is -framework OpenGL, etc....
> 
> Is there a standard way to handle this?  If not, is there any reason
> sdl-config can't get something like "--libs-gl" and "--libs-glu"
> options?  That way each Makefile could just use sdl-config --libs-glu
> and no separate rules will be needed for different platforms.
> 
> What do you all think about this?  Is there a better way I am missing?

My take on this is that all the development environments are just too
different for SDL to handle all this. On the Mac alone, there are two
totally different ways to reach SDL (via Frameworks or via more
traditional Unix styles.) Throw in Visual Studio into the mix, and 
you have pretty much no common ground to work with.

My solution is to use a a project/build generator. I discovered I was
too stupid to figure out autoconf/automake, and it really doesn't
address anything outside the Unix domain, so I don't use those.

But there are two I know of I think that are worth advertising. The
(Continue reading)

Enrico Urbano | 1 Apr 10:51 2005
Picon

Re: SDL/OpenGL and Portability

Hi, Autotools are fine in many projects, but you should be aware that there is "scons", I suggest its use because it's sympler, but it needs python for being installed. Scons claims to be more cross-platform, compatible/native with windows than autotools are. (need cygwin I guess.) As for packaging may I suggest http://www.autopackage.org/  for building linux binaries compatible with many distros? As a novice linux user (never packaged anything with it) it was a breeze to install software with it!

 

 

Nuovo Yahoo! Messenger E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica… Scaricalo ora!
_______________________________________________
SDL mailing list
SDL <at> libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
Muzero | 1 Apr 12:18 2005
Picon

BlitSurface question [BEGINNER]


hi to all, 
i'd like to take a piece of a surface from another surface, 
example:
1) init a surface1
2) load into it an image
3) copy a part of surface1 and put in surface2

i written this code:

    // initialize *background surface and load an image
    SDL_Surface * tspr = new SDL_Surface;;
    SDL_Rect take;

    take.x = x1;
    take.y = y1;
    take.w = x2-x1;
    take.h = y2-y1;

    cerr << "TAKE " <<    SDL_BlitSurface(background, &take , tspr, &take) << endl;

   // refresh
    SDL_SaveBMP(tspr,"tmp00000.bmp");

well this code do not work...the blitsurface returns 0 but the tmp00000.bmp has null size,
i suppose that SDL_BlitSurface(background, &take , tspr, &take) take a part of background and put it in tspr...

whats' wrong? 
thx

Fosco
Guido Reimer | 1 Apr 14:34 2005
Picon

zsnes and dfbmga

Hi,

I don't get that f***** zsnes to work on my G400 DH cards TV-OUT.
I tried mplayer with TV-OUT and this is working very fine and I think I have
configured SDL and DirectFB right.
This is the error, that I get:

# zsnes -z ~/smw.smc

ZSNES vPre 1.43, (c) 1997-2005, ZSNES Team Be sure to check
http://www.zsnes.com/ for the latest version.
Please report crashes to zsnes-devel <at> lists.sourceforge.net.

ZSNES is written by the ZSNES Team (See AUTHORS.TXT) ZSNES comes with
ABSOLUTELY NO WARRANTY.  This is free software, and you are welcome to
redistribute it under certain conditions; please read 'LICENSE.TXT'
thoroughly before doing so.

Use ZSNES -? for command line definitions.

MMX support found and enabled.

File opened successfully!
(*) DirectFB/Config: Parsing config file '/etc/directfbrc'.

       ---------------------- DirectFB v0.9.22 ---------------------
             (c) 2000-2002  convergence integrated media GmbH
             (c) 2002-2004  convergence GmbH
        -----------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2005-03-31 07:49)
(*) Direct/Memcpy: Using MMXEXT optimized memcpy()
(*) Direct/Thread: Running 'VT Switcher' (CRITICAL, 2348)...
(*) Direct/Thread: Running 'PS/2 Input' (INPUT, 2350)...
(!!!)  *** UNIMPLEMENTED [fusion_reactor_set_lock] *** [reactor.c:802]
(*) DirectFB/Input: IMPS/2 Mouse 1.0 (Convergence GmbH)
(*) Direct/Thread: Running 'Keyboard Input' (INPUT, 2368)...
(*) DirectFB/Input: Keyboard 0.9 (convergence integrated media GmbH)
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: Matrox G400 0.7 (convergence integrated media GmbH)
(*) DirectFB/Core/WM: Default 0.2 (Convergence GmbH) SDL
DirectFB_SetVideoMode: 640x480 <at> 16, flags: 0xc0000001
(!) [ 2343:    0.000] --> Caught signal 11 (at (nil), invalid address) <--
Killed
#

Can somebody help me? I am using a 2.6.11 Kernel.

Thanks

Mit freundlichen Grüßen / Kind Regards
Guido Reimer
--------------------------------------

ICAP LTD. & CO. OHG
Stephanstrasse 3
60313 Frankfurt am Main
eMail: g.reimer <at> garbanicap.de
BlackBerry: g.reimer <at> instantemail.t-mobile.de
--------------------------------------

 
Todd Lang | 1 Apr 16:55 2005
Picon

Re: BlitSurface question [BEGINNER]

>     // initialize *background surface and load an image
>     SDL_Surface * tspr = new SDL_Surface;;
>     SDL_Rect take;
>
>     take.x = x1;
>     take.y = y1;
>     take.w = x2-x1;
>     take.h = y2-y1;
>
>     cerr << "TAKE " <<    SDL_BlitSurface(background, &take , tspr, &take)
> << endl;
>
>    // refresh
>     SDL_SaveBMP(tspr,"tmp00000.bmp");
>
>
You will need to initialize your new surface "tspr" with a size before
blitting on to it.  "New"ing a surface doesn't create a canvas for you to
paint on, it just gets your easel set up.

You need to call SDL_CreateRGBSurface with all of the necessary settings
to initialize tspr.
Alexander Becker | 1 Apr 19:07 2005
Picon

printing out a text

Hello!

How can I print out a text in a simple application-window?

Here is my non-working test-code:

#!/Perl/bin/perl

use strict;
use warnings;
use SDL;
use SDL::App;
use SDL::Rect;
use SDL::Color;
use SDL::Surface;
use SDL::Tool::Font;
use SDL::TTFont;

############################################################
# Definieren der Elemente des Programms                    #
############################################################

my $app = new SDL::App (
     -title => 'Animation',
     -width => 640,
     -height => 480,
     -depth => 32,
);

my $color = SDL::Color->new(
     -r => 0x00,
     -g => 0x00,
     -b => 0xff,
);

my %rect = (); # alle rects
my $title_text = "Text"; # test-output
my $background = SDL::Surface->new(-name => "level_editor.png");
my $surface_dialog = SDL::Surface->new(-name => "void_panel.png");

$rect{dialog} = SDL::Rect->new(
     -x      => 0,
     '-y'    => 0,
     -width  => $surface_dialog->width,
     -height => $surface_dialog->height,
);
$rect{middle} = get_dialog_rect();

$surface_dialog->blit($rect{dialog}, $app, $rect{middle});
$app->print(
     $rect{middle}->x + $rect{middle}->width/2 - 12 * length($title_text)/2,
     $rect{middle}->y + 5, uc($title_text)
);

############################################################
# Aktionen definieren                                      #
############################################################

my %actions = (
     SDL_QUIT() => sub { exit(0); },
     SDL_KEYDOWN() => \&keydown,
);

############################################################
# MainLoop                                                 #
############################################################
$app->loop(\%actions);

############################################################
# SUBS                                                     #
############################################################

sub keydown {
     # subroutine to get the rect where the promt will go
     my $t = "Text";
     my $dialog = get_dialog_rect();
     $app->print(
         $dialog->x + $dialog->width/2 - 12 * length($t)/2,
         $dialog->y + 5,
         $t,
     );
} # /keydown

sub get_dialog_rect {
     SDL::Rect->new(
         -x => 320 - $surface_dialog->width/2,
         '-y' => 320 - $surface_dialog->height/2,
		    -width => $surface_dialog->width, -height => $surface_dialog->height,
     );
}

The error-output is: "Fatal signal: Segmentation Fault (SDL Parachute 
Deployed)"

Any ideas / examples (no need using perl)?
mfg Alex
Jack Doe | 1 Apr 19:48 2005
Picon

Re: printing out a text

Ummm, not sure of SDL_ttf has been ported over to perl but that's one
way to do it. There is another way, which is to blit prerendered text
onto your surfaces thus creating semi-magical words on your
applications screen surface.

If you need some point of reference, search for "BFont" or "SFont"
they are by far the most part the most popular addon libraries for
rendering bitmap text.

Happy hacking!
Golgoth! | 1 Apr 22:30 2005
Picon

SDL Cursor and Fullscreen!

Hi all!

i have adress this issue about a year ago... i ve manage to work around but 
this time its getting a bigger problem...

The cursor is not showing or behave funny in full screen... for some reason it 
work fine in window mode... so, something is happening to the cursor handlening 
in full screen... we know that for sure...

in this case sdl may not be the problem here but i ll like to get a 
confirmation on this:

exemple, playing a quicktime movie in window mode throught an sdl 
window/surface on windows xp... quicktime hide the cursor... when the movie is 
done... it gives back the cursor... in full screen... after the movie s done... 
the cursor and mouse buttons are not responding at all...

once again, in this case there s a slight chance that sdl is not involve 
here... but i doubt it...

my question is... the mouse/cursor handeling in window mode is great... can we 
reproduce the same behaviour in full screen? if yes.. how would we do this?

THX

Gmane