Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Cyrano

Pages: 1 [2]
16
Audio / Multiple audio channels that can be individually managed
« on: April 22, 2010, 03:55:33 pm »
Quote from: "Laurent"
What is a channel for you? SFML doesn't have such a notion.


A channel for me would be... something like a path for the sound to go through on its way to output. I had always thought of it as, say in an audio recording program where multiple tracks are layered together, and all still maintain the same volume/qualities they each had before they were mashed together. All I want is to be able to do that in real-time. I realize this may not be possible, if that is the case, so be it; I'll find a way to work around it.

Thanks again!

-Cyrano

17
Graphics / Sprite Rendering, bit blitting, and other questions
« on: April 22, 2010, 03:49:03 pm »
Quote from: "Laurent"
Quote
What is the fastest way to render a sprite? (I'm not entirely sure what people on this site mean by "render"; from what I understand, it's fairly similar to bit blitting.)

"Render" just means "draw".
There's only one way to render a sprite in SFML, so there nothing much to discuss about it.

Quote
What's the deal with "arrays of pixels?" I keep seeing this term, but do not fully grasp what it means. Is it perhaps referring to all the pixels in an individual image?

It refers to a bidimensional array of pixels (32-bits RGBA colors), usually the pixels that define an image or a portion of it.

Quote
Why do some people say bit blitting is slow? Is there some faster method I was not aware of?

Bit blitting is completely deprecated with today's hardware. The most efficient way of drawing things, even 2D geometry, is to create geometry made of triangles, map some texture on it and send it to the graphics card.

Quote
What is the screen tear effect? Is this the phenomenon that occurs when update cycles are faster than the monitor's refresh rate? (Dumb question, but I just want to make sure I get it). Is there a way around it?

You can enable vertical synchronization to solve this problem (see sf::Window::UseVerticalSync).

Quote
Can a screen (game screen) be updated in part? (Ex: A character sprite is updated, but not the whole background with it.)

This is not a good strategy, you should always clear and redraw the entire scene.


Thanks! I was wondering about those things.

I have another question though:

How do I use that "geometry of triangles" you mention? (I'm assuming you are referring to something like a gourad shader?) I'm only using 2D art, and have no use for 3D figures. If it helps, I'm designing and programming a 2D side-scroller game (think mario). I want to use high quality graphics, but I also want high performance too. That's why I was asking if there was a faster way to accomplish bit blitting.

Thanks again!

-Cyrano

18
Graphics / Sprite Rendering, bit blitting, and other questions
« on: April 22, 2010, 07:54:46 am »
SFML is a fine library, but once again, I have some questions regarding one of its core areas: Sprite manipulation.

My Questions:

What is the fastest way to render a sprite? (I'm not entirely sure what people on this site mean by "render"; from what I understand, it's fairly similar to bit blitting.)

What's the deal with "arrays of pixels?" I keep seeing this term, but do not fully grasp what it means. Is it perhaps referring to all the pixels in an individual image?

Why do some people say bit blitting is slow?
Is there some faster method I was not aware of?

What is the screen tear effect?
Is this the phenomenon that occurs when update cycles are faster than the monitor's refresh rate? (Dumb question, but I just want to make sure I get it). Is there a way around it?

Can a screen (game screen) be updated in part? (Ex: A character sprite is updated, but not the whole background with it.)


These are some questions I've wanted answers to for a while, but did not know whom to ask. I put all these questions together so that I don't have to spam other people's topics or create a bunch of topics of my own.

Thanks in advance. Happy programming!

-Cyrano

19
Audio / Multiple audio channels that can be individually managed
« on: April 22, 2010, 07:33:07 am »
I'm highly impressed with SFML, but I have some questions regarding its sound libraries:

How is a multi-channel sound que/array done? (Ex: Que has .wav1 & .wav2 stored in it. Channels A & B can have sounds sent from the que to them via, say a function in the application's code. In this way, sounds are loaded into a storage area for ease of reference within the program.)

Is there a built-in way to route sounds to different channels depending on situation? (Ex: A .wav1 normally plays on channel A, but .wav2 is currently playing on channel A. Can .wav be routed to channel B?)

Can individual channels be individually managed?
(Ex: Channel A is to be at 100% volume, channel B needs to be at 50%.)

I've heard that playing multiple sounds simultaneously lowers the volume in some circumstances. Can this be averted by using multiple audio channels? (Ex: .wav1 on channel A plays at 100%, .wav2 plays on channel B at 100%. Both need to sound like they do at full volume.)

Is it possible to give a "priority tag" to a sound, so as to determine what channel it plays on? (Ex: Channel A is at 100% volume, Channel B is at 50% volume. .wav1 has a rank of 5, so it outranks .wav2, which is a rank 2 sound. If both sounds try to play simultaneously, .wav1 will always get Channel A, the priority channel. However, if .wav1 is not playing, .wav2 can use Channel A.)


I do not have any source code at this time, but decided to post this to see if there are answers to my questions, before I get into a tangled programming mess.

Thanks in advance.

-Cyrano

Pages: 1 [2]
anything