Game example and api-open file

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to open
a file but still no find a library to make that :frowning: there is a api
to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the issue?–
Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to open
a file but still no find a library to make that :frowning: there is a api
to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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

If you’re just learning programming, doing a game is probably going to be
very complicated, and you may get frustrated and stop making the game.
Instead, the usual “first game” a programmer makes is number guessing; you
think of a number between 1 and 10, and the computer guesses (you tell it
higher/lower each guess).

Ya, fopen/fclose/fread will be your best bet for opening/reading files.
It’s absolutely cross platform, and it’s pretty simple, so don’t be too
worried :slight_smile:

A good resource might be http://roseindia.net/c-tutorials/index.shtml if you
like programming by example.
Otherwise, just do some google searches or post things on forums, and of
course, there’s always the mailing list here.

Hope that helps,
-AlexOn Thu, Nov 25, 2010 at 2:36 AM, Paulo Pinto <paulo.jpinto at gmail.com> wrote:

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the issue?


Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to open
a file but still no find a library to make that :frowning: there is a api
to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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


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

thank you 4 answer but I mean open a file from sdl-api. i.e. When i
clic a button open a page1.html =) or maybe put on a hiperlink text
in the windowOn 11/25/10, Alex Barry <alex.barry at gmail.com> wrote:

If you’re just learning programming, doing a game is probably going to be
very complicated, and you may get frustrated and stop making the game.
Instead, the usual “first game” a programmer makes is number guessing; you
think of a number between 1 and 10, and the computer guesses (you tell it
higher/lower each guess).

Ya, fopen/fclose/fread will be your best bet for opening/reading files.
It’s absolutely cross platform, and it’s pretty simple, so don’t be too
worried :slight_smile:

A good resource might be http://roseindia.net/c-tutorials/index.shtml if you
like programming by example.
Otherwise, just do some google searches or post things on forums, and of
course, there’s always the mailing list here.

Hope that helps,
-Alex

On Thu, Nov 25, 2010 at 2:36 AM, Paulo Pinto <paulo.jpinto at gmail.com> wrote:

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the issue?


Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez <@juan_hernandez> wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to open
a file but still no find a library to make that :frowning: there is a api
to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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


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

SDL does have file handling API, and you can find that here:
http://wiki.libsdl.org/moin.cgi/CategoryIO
To be honest, I don’t think it would be any more efficient to use SDL’s API
over the default C api, but that’s just my opinion - I haven’t done any
benchmark tests or anything.

Take care,
-AlexOn Thu, Nov 25, 2010 at 11:52 AM, juan hernandez wrote:

thank you 4 answer but I mean open a file from sdl-api. i.e. When i
clic a button open a page1.html =) or maybe put on a hiperlink text
in the window

On 11/25/10, Alex Barry <@Alex_Barry> wrote:

If you’re just learning programming, doing a game is probably going to be
very complicated, and you may get frustrated and stop making the game.
Instead, the usual “first game” a programmer makes is number guessing;
you
think of a number between 1 and 10, and the computer guesses (you tell it
higher/lower each guess).

Ya, fopen/fclose/fread will be your best bet for opening/reading files.
It’s absolutely cross platform, and it’s pretty simple, so don’t be too
worried :slight_smile:

A good resource might be http://roseindia.net/c-tutorials/index.shtml if
you
like programming by example.
Otherwise, just do some google searches or post things on forums, and of
course, there’s always the mailing list here.

Hope that helps,
-Alex

On Thu, Nov 25, 2010 at 2:36 AM, Paulo Pinto <paulo.jpinto at gmail.com> wrote:

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the issue?


Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to open
a file but still no find a library to make that :frowning: there is a api
to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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


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


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

It’s not completely clear what you expect SDL to do for you. SDL is much
lower level than opening, displaying, and interacting with HTML. SDL
basically gives you access to the pixels on the screen and leaves it up to
you to make them look like text and respond to user input as the user
expects. Often, this is done with extra libraries built upon SDL. If you
wanted to display an HTML file and your program doesn’t have the facilities
to do so, you would probably ask the OS to open the file in a web browser,
probably with a platform-specific system() call.

Jonny DOn Thu, Nov 25, 2010 at 11:52 AM, juan hernandez wrote:

thank you 4 answer but I mean open a file from sdl-api. i.e. When i
clic a button open a page1.html =) or maybe put on a hiperlink text
in the window

On 11/25/10, Alex Barry <alex.barry at gmail.com> wrote:

If you’re just learning programming, doing a game is probably going to be
very complicated, and you may get frustrated and stop making the game.
Instead, the usual “first game” a programmer makes is number guessing;
you
think of a number between 1 and 10, and the computer guesses (you tell it
higher/lower each guess).

Ya, fopen/fclose/fread will be your best bet for opening/reading files.
It’s absolutely cross platform, and it’s pretty simple, so don’t be too
worried :slight_smile:

A good resource might be http://roseindia.net/c-tutorials/index.shtml if
you
like programming by example.
Otherwise, just do some google searches or post things on forums, and of
course, there’s always the mailing list here.

Hope that helps,
-Alex

On Thu, Nov 25, 2010 at 2:36 AM, Paulo Pinto <paulo.jpinto at gmail.com> wrote:

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the issue?


Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to open
a file but still no find a library to make that :frowning: there is a api
to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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


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


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

Ok thank you for your point of view but for example over the window I
would like to have a hiperlink text or to press a button to take me a
web page. How do i have to resolve this issue?On 11/25/10, Alex Barry <alex.barry at gmail.com> wrote:

SDL does have file handling API, and you can find that here:
http://wiki.libsdl.org/moin.cgi/CategoryIO
To be honest, I don’t think it would be any more efficient to use SDL’s API
over the default C api, but that’s just my opinion - I haven’t done any
benchmark tests or anything.

Take care,
-Alex

On Thu, Nov 25, 2010 at 11:52 AM, juan hernandez <@juan_hernandez> wrote:

thank you 4 answer but I mean open a file from sdl-api. i.e. When i
clic a button open a page1.html =) or maybe put on a hiperlink text
in the window

On 11/25/10, Alex Barry <alex.barry at gmail.com> wrote:

If you’re just learning programming, doing a game is probably going to
be
very complicated, and you may get frustrated and stop making the game.
Instead, the usual “first game” a programmer makes is number guessing;
you
think of a number between 1 and 10, and the computer guesses (you tell
it
higher/lower each guess).

Ya, fopen/fclose/fread will be your best bet for opening/reading files.
It’s absolutely cross platform, and it’s pretty simple, so don’t be too
worried :slight_smile:

A good resource might be http://roseindia.net/c-tutorials/index.shtml if
you
like programming by example.
Otherwise, just do some google searches or post things on forums, and of
course, there’s always the mailing list here.

Hope that helps,
-Alex

On Thu, Nov 25, 2010 at 2:36 AM, Paulo Pinto <paulo.jpinto at gmail.com> wrote:

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the issue?


Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez <@juan_hernandez> wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to open
a file but still no find a library to make that :frowning: there is a api
to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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


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


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

SDL probably isn’t the library you want to you for clicking links to launch
webpages, but this is how I would do it:

  1. Create a surface with the url text drawn on it
  2. Create a rect for the location/size of the link
  3. Create a char* or char[] with the url
  4. When you get a click event and it’s inside the rect, use a console
    command to open the url.
    ex:
    Using firefox, do:
    firefox_executable -new-tab "url"
    Using IE, do:
    iexplorer.exe url
    Using Opera, do:
    opera_executable -remote "openURL(url, new-page)"
    Using Safari, do:
    open /Applications/Safari.app url

You should be able to do this by using system( “command” );

I hope that helps,
-AlexOn Thu, Nov 25, 2010 at 12:46 PM, juan hernandez wrote:

Ok thank you for your point of view but for example over the window I
would like to have a hiperlink text or to press a button to take me a
web page. How do i have to resolve this issue?

On 11/25/10, Alex Barry <@Alex_Barry> wrote:

SDL does have file handling API, and you can find that here:
http://wiki.libsdl.org/moin.cgi/CategoryIO
To be honest, I don’t think it would be any more efficient to use SDL’s
API
over the default C api, but that’s just my opinion - I haven’t done any
benchmark tests or anything.

Take care,
-Alex

On Thu, Nov 25, 2010 at 11:52 AM, juan hernandez wrote:

thank you 4 answer but I mean open a file from sdl-api. i.e. When i
clic a button open a page1.html =) or maybe put on a hiperlink text
in the window

On 11/25/10, Alex Barry <@Alex_Barry> wrote:

If you’re just learning programming, doing a game is probably going to
be
very complicated, and you may get frustrated and stop making the game.
Instead, the usual “first game” a programmer makes is number guessing;
you
think of a number between 1 and 10, and the computer guesses (you tell
it
higher/lower each guess).

Ya, fopen/fclose/fread will be your best bet for opening/reading
files.

It’s absolutely cross platform, and it’s pretty simple, so don’t be
too

worried :slight_smile:

A good resource might be http://roseindia.net/c-tutorials/index.shtmlif
you
like programming by example.
Otherwise, just do some google searches or post things on forums, and
of

course, there’s always the mailing list here.

Hope that helps,
-Alex

On Thu, Nov 25, 2010 at 2:36 AM, Paulo Pinto <paulo.jpinto at gmail.com> wrote:

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the
issue?


Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to
open

a file but still no find a library to make that :frowning: there is a
api

to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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


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


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


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

In my opinion, I think you should try another application framework, a more
complex one, such as QT. It is a cross-platform framework from Nokia, under
LGPL, it has label widget which can:
ui->label->setOpenExternalLinks(true);
ui->label->setText(“example”);

SDL only give you power to change screen`s color and to tell where is your
mouse. It even need you to teach it how to display English on screen.

2010/11/26 juan hernandez > Ok thank you for your point of view but for example over the window I

would like to have a hiperlink text or to press a button to take me a
web page. How do i have to resolve this issue?

On 11/25/10, Alex Barry <alex.barry at gmail.com> wrote:

SDL does have file handling API, and you can find that here:
http://wiki.libsdl.org/moin.cgi/CategoryIO
To be honest, I don’t think it would be any more efficient to use SDL’s
API
over the default C api, but that’s just my opinion - I haven’t done any
benchmark tests or anything.

Take care,
-Alex

On Thu, Nov 25, 2010 at 11:52 AM, juan hernandez wrote:

thank you 4 answer but I mean open a file from sdl-api. i.e. When i
clic a button open a page1.html =) or maybe put on a hiperlink text
in the window

On 11/25/10, Alex Barry <alex.barry at gmail.com> wrote:

If you’re just learning programming, doing a game is probably going to
be
very complicated, and you may get frustrated and stop making the game.
Instead, the usual “first game” a programmer makes is number guessing;
you
think of a number between 1 and 10, and the computer guesses (you tell
it
higher/lower each guess).

Ya, fopen/fclose/fread will be your best bet for opening/reading
files.

It’s absolutely cross platform, and it’s pretty simple, so don’t be
too

worried :slight_smile:

A good resource might be http://roseindia.net/c-tutorials/index.shtmlif
you
like programming by example.
Otherwise, just do some google searches or post things on forums, and
of

course, there’s always the mailing list here.

Hope that helps,
-Alex

On Thu, Nov 25, 2010 at 2:36 AM, Paulo Pinto <paulo.jpinto at gmail.com> wrote:

I think that somehow you have missed the tutorials page:

http://wiki.libsdl.org/moin.cgi/Tutorials

To open a file just use the C API fopen()/fclose(), what is the
issue?


Paulo

On Thu, Nov 25, 2010 at 6:45 AM, juan hernandez wrote:

Hello I am learning step by step and i have 2 questions:
first i am looking 4 a basic game example to get know the api. I
search in the page libsdl but still no find any basic aplication.
Anybody has a basic game example to learn? second i would like to
open

a file but still no find a library to make that :frowning: there is a
api

to open a file? Would be a great to open a file i.e. X.Html, x.pdf,
etc etc
thank you


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


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


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


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

basic game =

nodchod http://www.cloudsprinter.com/random/nodchod.tar.gz

crazeespod http://www.cloudsprinter.com/random/crazeespod.src.zip

crazeespod has gp2x / joystick

thank you i will check the sitesOn 11/26/10, Neil White wrote:

basic game =

nodchod http://www.cloudsprinter.com/random/nodchod.tar.gz

crazeespod http://www.cloudsprinter.com/random/crazeespod.src.zip

crazeespod has gp2x / joystick