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 - SirusDoma

Pages: [1]
1
Thanks for your reply, I will consider to create it in initialization instead, or implement with your suggestion. Thanks

2
And? What's wrong with OpenGL being called by SFML?

Yea, additional OpenGL calls. It may doesn't affect the performance if i do it in initialization, it may only take few ms but as we know we should minimize any OpenGL calls in the game loop.

Quote
I don't understand why you're so worried about performances. Creation of the texture atlas will happen once, preferably during init/loading, so the time it takes should never be an issue (as long as you don't do something wrong that makes it take several seconds). Just use an implementation that you like, and/or that is simple enough.

Oops, my bad not to explain whole things in the first post. The TextureAtlas class can be used any purpose, indeed it obviously to compose a sets of Texture (or Image?) to the single Texture  ;D but it may ideal to other purpose, such as Sprite batching.

When the very first render is called, the sprite batch gathers all information about sprite that pushed into it as well as push the sprite texture into the texture atlas.The texture is cached inside the atlas, so whenever any sprite is added with same texture, it shouldn't add it again, the number of texture inside texture atlas remain the same.

As the game progress, a new sprite with unique texture may appear and pushed into sprite batch, in other words the texture atlas can be used to construct dynamic sprite batching and the newly added sprite texture need to updated into atlas.

Though this is one of its example (but yea, I intended to use this for sprite batching), there maybe other applicable implementation beyond my thinking which probably i need on later.

Therefore, I need to determine which is the best approach to achieve this
Anyway, thanks for your reply

3
Backup your texture data to an image, re-recreate the texture with the new size, copy the previous data back into the new texture and finally add your new data (both with Texture::update).

Or you can work in a sf::Image until everything's done, and convert it to a sf::Texture at the end of the process.

Interesting, the first method sounds simple, but it seems it require additional OpenGL calls. i mean, before recreating the texture, I must destroy the last texture which I suppose dispose the OpenGL Texture and it require OpenGL call to do so as well as sending back the image data to the texture (CMIIW)

the 2nd one may give better performance, but not sure it is really better in term of performance and how to implement it

Anyway, which one you think will be faster in term of performance? the creation of the texture atlas might / might not as often as draw calls, that's why i'm considering which one that give me better performance

Thanks in advance

4
I try to create Texture atlas on the fly from a sets of image. Initially, I create my own class, let's say TextureAtlas, it contains a sf::Texture. Later on, the image will be updated to this sf::Texture

in the construction phase of TextureAtlas , let say, the first image is being uploaded to texture data:
    sf::Texture texture;
    if (!texture.loadFromFile("something.png")) // let's assume the image size is 80x80
    {
        // error...
    }
 

Now, when a new image is need to be uploaded into the atlas, the first thing that comes from my mind is to resize the texture then update the texture with the new image.

For example, the new image contains 100x100 image, since the last image size is 80x80 and i want to advance horizontally (X axis) so the next image will be placed on x:80 y:0 while the image need to resize to 180x100

It appears that if I call sf::Texture::update(), the new image *seems* uploaded but the sf::Texture size will remain the same. in above case, the sf::Texture remain 80x80, while the new image uploaded on x:80, that means the new image is not included and nothing changed to the sf:Texture!

So... how do I achieve this with SFML?

5
SFML website / Re: Move community chat to gitter
« on: December 04, 2016, 02:10:07 pm »
I'm not expert in IRC, barely new with this one haha
but it is strange that it seems i could connect to the chat without any problem on IRC Client

however, I prefer to chat over the browser, is there any alternative so i can chat in the browser instead using IRC Client?

Thanks in advance  :)

6
SFML website / Re: Move community chat to gitter
« on: December 03, 2016, 06:40:34 pm »
Ah I see, that would make sense to stay at IRC.
I will give it a try about bounce

But idk why my internet is fine, but having hard times to chat in IRC..

7
SFML website / Move community chat to gitter
« on: December 03, 2016, 04:06:59 pm »
You may recognize me on chat.sfml-dev.org since 1 or 2 days ago as someone who always disconnected guy lol. I don't understand why it is hard for me to connecting to the chat while my internet is fine.

I would recommend to use http://gitter.im/ instead, how do you guys think?

8
DotNet / Re: Compatibility and Dependencies
« on: May 11, 2015, 02:48:33 am »
Thank you for answer!
It make things clear, one question, regarding your statement

Quote
and do i need put all csfml dll files beside my executable in order to make my game run properly?

Yes, same as any of dlls - they must be in a location where the OS can find them.

In Windows platform, can i just put csfml dll files in C:\Windows\System32\ ?

9
DotNet / Compatibility and Dependencies
« on: May 10, 2015, 06:37:55 pm »
Hello i am looking for 2D Game Library with C# language and i found SFML.
I haven't give a try to this library, i have something to ask before decide to use SFML.NET

first, based what i read at download page:
Quote
SFML.Net is the official binding of SFML for the .Net language family (C#, VB.Net, C++/CLI, etc.). It is built on top of the C binding, CSFML, to ensure maximum compatibility across platforms (i.e. it works with Mono)

I see SFML.NET is able to run with Mono and cross platforms but i only see .dll files under libs folder which, i think its.. only compatible at windows?

and do i need put all csfml dll files beside my executable in order to make my game run properly? is there a way to embed them or.. a SFML .NET port that fully written in C# with OpenTK?

sorry if the questions sounds nonsense / newbie
but, thanks!

Pages: [1]