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

Pages: 1 2 [3]
31
I don't think the initial content of a texture is clearly defined in the OpenGL standard. So yes, it must be cleared first (or completely overwritten).

I think if I went through my code right now, it's sometimes I do and sometimes I don't. I'll have to check and add clear calls to all of them if I want to check.

Quote
Wow... 3 expensive texture copies in 3 lines of code, where you only need 1 :P

Yeah I realised soon after I posted that I needed to update this code, should really be passing in by reference. ^^;

32
you remove rebdertexture everyframe as i see thats is - conputer slowdown and memory leaks aka artefacts

I don't think so, the above method I used is only used once when creating a texture, usually in initialisation. I do also use a render texture to render the entire scene, set its texture to a sprite and then scale it, but the render texture is created once and only removed when the application is closed.

33
Graphics / Strange Rendering Behaviour with sf::Text and sf::RenderTexture
« on: November 13, 2015, 01:37:00 am »
So I've been having this weird rendering issue. My game project uses very specific text rendering, which requires me to paste text onto a texture, and then render it as a sprite or another render entity using VertexArrays. Below is one example of how I achieve this:

if (!VContent::FindTexture("player"))
        {
                sf::RenderTexture renderTex;
                renderTex.create(18, 26);

                sf::Font font;
                VContent::LoadFont("Assets\\lucon.ttf", font);
                sf::Text text = sf::Text("@", font, 32);
                text.setColor(sf::Color::White);
                text.setStyle(sf::Text::Regular);
                text.setPosition(0, -7);
                renderTex.draw(text);
                renderTex.display();

                VContent::StoreTexture("player", renderTex.getTexture());
        }

VContent by the way, is my content manager, which I use to store and load textures and other copyable assets essentially anywhere in my project. It stores textures like so:

bool VContent::StoreTexture(string name, sf::Texture texture)
{
        if (!FindTexture(name))
        {
                sf::Texture tex(texture);
                textureDir.insert(textureDir.begin(), std::pair<string, sf::Texture>(name, tex));

#if _DEBUG
                cout << name << " stored." << endl;
#endif
               
                return true;
        }

#if _DEBUG
        cout << "Error storing texture: " << name << endl;
#endif

        return false;
}

Anyway, on my home PC (see left image) it displays like normal with the text being rendered with the correct characters, but when I was testing on another PC (see image right), I was getting incorrect characters and random artefacts.



As far as hardware is concerned, there isn't much difference as they are both have Intel Core iSeries CPU, decent hard drive space and are both relatively high performance machines (although my home PC has a dedicated gaming graphics card, but I haven't discovered if the other PC has one itself).

34
Why is zlib an issue? Writing your own deflate/inflate implementation is not really worth the effort. ;)
SFML supports also other font formats, TTF are just the most common used ones, see here.

The issues were ones I were concerned with, mainly if people might be put off with linking another library to their projects. The second one I thought text were limited to TTF, and that REXPaint's were based on bitmap fonts, but if other font options are available then it's not much of an issue then.

35
SFML projects / XPText - A Text Renderer for the ASCII art tool REXPaint
« on: November 03, 2015, 02:27:17 am »
Hello there! Thought I'd finally make my forum debut by showing this neat little project I just uploaded.

REXPaint is an ASCII art tool developed by GridSageGames, as the summary implies, it allows you to produce artwork using text, a particular art form found in roguelike games.

REXReader++ is a lightweight file reader class that allows you to decompress and read REXPaint's xp file format in a readable tilemap structure. What I did was use this with a custom text class so you can render your REXPaint creations in SFML 2.0!


Pages: 1 2 [3]
anything