Need to manage cursor position & other things fron c program

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
benny7440
Posts: 440
Joined: Mon 20 Apr 2009, 04:23

Need to manage cursor position & other things fron c program

#1 Post by benny7440 »

... someone somewhere gave me the advise to d/l SDL for having those capabilities as to include some special characters anywhere in the screen with an arbitrary orientation: I started many months ago a game that needs the whole screen, putting there at some spots a graphic in one of the possible orientations & changing the background color without loosing any characters or graphics already there.

The problem I had then was caused by myself for deleting everything that included "glade" in its name (blindly). So, I stopped for about 2 months my c program until I managed my mess. Finally I did d/l a newer version of Puppy Linux (528.005) but didn't continued my c program. Now I want to finish it before I completely forget all/most of what I've learned.

I asked more or less the same thing many months ago but failed to receive any replies to it, that post is at: http://www.murga-linux.com/puppy/viewtopic.php?t=77874

Where I can go to learn what other/new commands Iĺl have with SDL? Do I need something extra apart from SDL?

Thanks to all!
[b]Toshiba Satellite L555 / ACPI x64-based PC / Intel Core i5 / ~1.46 @ 3 Partitions GB HDD / 4 GB RAM / CD-DVD RW Drive.
[/b]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

What exactly are you wanting to do? Get cursor position, warp it to a specific location,...? And what other stuff.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#3 Post by goingnuts »

The SDL man-pages holds loads of info:

Code: Select all

SDL_WarpMouse(3)               SDL API Reference              SDL_WarpMouse(3)

NAME
       SDL_WarpMouse - Set the position of the mouse cursor.

SYNOPSIS
       #include "SDL.h"

       void SDL_WarpMouse(Uint16 x, Uint16 y);

DESCRIPTION
       Set  the position of the mouse cursor (generates a mouse motion event).

SEE ALSO
       SDL_MouseMotionEvent

SDL                         Tue 11 Sep 2001, 23:01            SDL_WarpMouse(3)
Depending on you project you might need other SDL-libs (SDL_mixer/SDL_net/SDL_GUI/SDL_image)...

User avatar
benny7440
Posts: 440
Joined: Mon 20 Apr 2009, 04:23

#4 Post by benny7440 »

Thanks, technosaurus & goingnuts, for replying!

My program is for playing dominoes against the "machine' & for that I need an array of graphics to show at the screen; it would not hurt if I could include some sound files there, too.

About the SDL links to visit, that will have to wait until a thunderstorm near my home goes away; probably tonight might be a good moment, sorry... I'll post anything regarding this last thing after reading about it.
[b]Toshiba Satellite L555 / ACPI x64-based PC / Intel Core i5 / ~1.46 @ 3 Partitions GB HDD / 4 GB RAM / CD-DVD RW Drive.
[/b]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#5 Post by technosaurus »

I wrote a really stupid simple game framework in gtk (It compiles to ~2kb) that just draws images, lines, shapes, text ... (anything supported by svg) and returns all locations of mouse clicks and key presses.
http://www.murga-linux.com/puppy/viewtopic.php?t=80352
I designed it for use with scripting languages like bash, lua, tcl, perl, python etc... but it will work with anything that can read streams (like stdin) and can write files (for instance game.svg) ... should work great for dominoes. If you aren't dead set on SDL, feel free to use it as is or adapt it -- released to public domain or any OSI approved license with no warranty.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply