Need more help

hi again from the new kid

I have more questions and I do not fond the answers in SDL doc.

when I run a SDL program, a prompt also appears… why?
how can I make it desappear?

how do SDL works with text output and text input?
do I have to make it myself?

I can’t understand why the next code does not work:

SDL_Event event;
event.type = SDL_SOMEACTION;

SDL_WaitEvent(event);

SDL_Event should not wait for an event?
In debug it just passes by…

tkz 4 any answer
Pedro Santos

hi again from the new kid

I have more questions and I do not fond the answers in SDL doc.

when I run a SDL program, a prompt also appears… why?
how can I make it desappear?

I’m not certain what you are talking about. What OS are you using? What does
the “prompt” say?

how do SDL works with text output and text input?
do I have to make it myself?

If you mean surfaces representing text, then there are a couple of things you
can do:

  1. Handle all the text yourself (blit surfaces with text in them, or whatever)

  2. Use one of the many SDL font add-on libraries.
    http://www.libsdl.org/libraries.html

If you want to make something like a console (eg, the console in the Quake
games) you can try SDL_Console:
http://www.wpi.EDU/~mongoose/SDL_Console/

As far as imput from the keyboard, event handling works fine for me. Take a
look at the “Input Handling” doc:
http://sdldoc.csn.ul.ie/guideinputkeyboard.php

I can’t understand why the next code does not work:

SDL_Event event;
event.type = SDL_SOMEACTION;

SDL_WaitEvent(event);

SDL_Event should not wait for an event?
In debug it just passes by…

I’m not really certain what you were intending to do here, but be certain to
read the “Using Events” doc:
http://www.libsdl.org/intro/usingevents.html

to make sure you are using the functions right.On Wed, 09 May 2001, you wrote:


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

how do SDL works with text output and text input?
do I have to make it myself?

If you mean writing text to an SDL surface, yes, you do. However, there
are libraries built on top of SDL (SDL_ttf, ParaGUI, etc) that give this
functionality in varying degrees.

I can’t understand why the next code does not work:

SDL_Event event;
event.type = SDL_SOMEACTION;

SDL_WaitEvent(event);

(that should be SDL_WaitEvent(&event);)

SDL_WaitEvent doesn’t wait for a specific event. It waits for ANY event,
so it will drop through whenever you hit a key, move the mouse, etc. If
you need to wait for a specific event, check event.type after
SDL_WaitEvent returns, and see if it is the event you are waiting
for. Otherwise, call SDL_WaitEvent() again. If you need to do other
processing while waiting for the event, try SDL_PollEvent() instead, which
doesn’t block.

–ryan.

when I run a SDL program, a prompt also appears… why?
how can I make it desappear?
I’m not certain what you are talking about. What OS are you using?
What does
the “prompt” say?

In his original message:

“X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)”

I bet he’s referring to the MS-DOS console window for stdout that
opens up when a console SDL program isn’t run from an existing console
window.–

Olivier A. Dagenais - Software Architect and Developer