Video, WM_Events

Hello people,

I have several questions about our beloved SDL :slight_smile: I’ll be laconic,
here they are:

 1.  How can I rotate surface(image) to blit picture in different
 angles? Can't I?
 2. Is there any function similar to StretchBlt() in DirectDraw,
 that scales the image?
 3. How can I react on every WM Message I want? WM_IDLE, for
 example? Here some example is desirable...

Thanks in advance, I’m sure you people can answer those Qs.–
Best regards,
Flashback

Hello people,

I have several questions about our beloved SDL :slight_smile: I’ll be laconic,
here they are:

 1.  How can I rotate surface(image) to blit picture in different
 angles? Can't I?
 2. Is there any function similar to StretchBlt() in DirectDraw,
 that scales the image?

If you are going to be rotating and scaling images sparingly, you might
want to google for some algorithms that you can plug in. Or you could
just use SDL_gfx. I’m not entirely sure this is the best place to get
it since I’ve never used it, but it looks like a place to get it.
http://www.ferzkopp.net/~aschiffler/Software/SDL_gfx-2.0/

If you find SDL_gfx is a bit too slow, perhaps you’ll want to work with
OpenGL instead.

 3. How can I react on every WM Message I want? WM_IDLE, for
 example? Here some example is desirable...

You will have to write your own Windows specific code to catch WM_IDLE.
I don’t know off-hand how similar other platforms implement this type
of feature. I think this might be slightly outside the scope of SDL
(though as expressed to me in the past, many people seem to think that
SDL should be much more … all-encompassing than it is.)On Sep 8, 2004, at 8:48 AM, Flashback wrote:

Thanks in advance, I’m sure you people can answer those Qs.

–
Best regards,
Flashback


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi!

Donny Viszneki wrote:

Or you could
just use SDL_gfx. I’m not entirely sure this is the best place to get
it since I’ve never used it, but it looks like a place to get it.
http://www.ferzkopp.net/~aschiffler/Software/SDL_gfx-2.0/

Thanks, I’ll check that.

If you find SDL_gfx is a bit too slow, perhaps you’ll want to work with
OpenGL instead.
Yes, I require quick code very much, because I’m writing a
graphical engine. But I never worked with OpenGL before. Is it
good and/or quick to emulate 2D through 3D? What advantages would
I get?

You will have to write your own Windows specific code to catch WM_IDLE.
I don’t know off-hand how similar other platforms implement this type
of feature. I think this might be slightly outside the scope of SDL
(though as expressed to me in the past, many people seem to think that
SDL should be much more … all-encompassing than it is.)
Actually, I’m counting only on Windows users audience. …Though I
use no windows-related code, but STD libraries (like stdio.h,
string.h, etc), and compile everything with “VS .NET 2003”. I
doubt very much that my engine will work under Linux. Right?–
Best regards,
Flashback

Quoth Flashback , on 2004-09-11 15:07:18 +0300:

If you find SDL_gfx is a bit too slow, perhaps you’ll want to work with
OpenGL instead.
Yes, I require quick code very much, because I’m writing a
graphical engine. But I never worked with OpenGL before. Is it
good and/or quick to emulate 2D through 3D? What advantages would
I get?

The primary advantage of using OpenGL rather than doing all your effects
through straight software pixel manipulation (as I assume SDL_gfx does?)
is that, if your OpenGL drivers are reasonably done, you get to take
advantage of the GPU in your graphics card to perform some operations
faster and/or more parallelizedly than you could with the CPU. For
instance, if your graphics card accelerates texturing, you can upload
your image to texture memory and then get fast warping of it (including
rotation and scaling and such) by drawing polygons using it as a
texture.

You wouldn’t really be “emulating 2D with 3D”, note; using OpenGL for 2D
usually involves setting up a projection such that the third dimension
just never gets used. There are plenty of applications that use OpenGL
for 2D rendering; Chromium B.S.U. comes to mind, for instance, or the
OpenGL modes of Kobo Deluxe.

—> Drake Wilson
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040911/535efdeb/attachment.pgp

Flashback wrote:

Hi!

 Actually, I'm counting only on Windows users audience. ...Though I
 use no windows-related code, but STD libraries (like stdio.h,
 string.h, etc), and compile everything with "VS .NET 2003". I
 doubt very much that my engine will work under Linux. Right?

If you only use standard C (C++) libraries, you should be OK when
porting. But if one doesn’t have enough experience in programming for
various platforms, you’re gonna one way or the other use some
non-standard features of your compiler and/or OS. This may be just a
glitch or a major obstacle when porting.
Another problem may be performance. Not always but sometimes different
platform perform different jobs at (drastically) different speeds. So
when writing code, you’ll have to take these into consideration, and
either write two versions of code, or use an
always-performing-reasonable approach.

All the above applies only in case you’re pondering on making your
program portable (by yourself or others.)

-yzt