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

Pages: 1 [2]
Feature requests / Friendly string mapping to Keyboard::Key
« on: October 23, 2015, 07:10:32 am »
This is a minor request, and is not urgent at all.

I think it'll be beneficial to have a vector of strings or char* that corresponds to the Keyboard::Key enumerator.  I don't plan to use this for comparison but rather for presentation.

Having this will allow me to log more meaningful debugging messages (rather than logging indices), and this could also be used to present to the user when binding controls.

Window / Re: Get Window Position
« on: April 04, 2015, 12:11:55 am »
Yeah I was just looking into these functions.  I haven't produced the results I was looking for yet, but this looks like the way to go.

I just wanted to double if I was overlooking something before I started implementing conversion functions for each operating system.

Thank you for your help, Laurent

Edit:  How do I mark this topic as solved?  Do I just change the title?

Window / Re: Get Window Position
« on: April 03, 2015, 10:39:34 pm »
In certain states of this application, I plan to clamp the OS mouse pointer to specific regions.

For Windows, I use ClipCursor which accepts a rectangle, but this rectangle is relative to the upper left corner of the desktop instead of the application window.  I've tried offsetting the rectangle by the window's position, but the clamp region is still off by the size of the window's title bar.

Window / Get Window Position
« on: April 03, 2015, 08:29:54 pm »

I feel like I'm overlooking something.  I need a way to get the window's position without the title bar.

The Window::getPosition function returns the upper left corner of the window's title bar, but I need the upper left corner of the rendered content within the window.

Graphics / Re: Text character size documentation
« on: March 10, 2015, 02:58:36 am »
Thank you for the heads up, Exploiter.  I'll be sure to update my bookmarks to reference the latest documentation.

The reason why I ask about character size is to ensure that text does not go beyond boundaries for functions that handle horizontal/vertical alignment, text wrapping, and clamping.  I do hope some time in the future, I'll be able to demonstrate how my UI module appears, but I still have much work to do.

Graphics / Text character size documentation
« on: March 08, 2015, 07:39:48 pm »

I would like to request for further information on the Text class's character size.  I've read up the documentation from:

Unfortunately, the description of the character size functions did not provide the answer I was searching for.  What is the character size measuring?  Vertical length of a character (if so, what's the difference between font's line spacing and this)?  Horizontal length of a character (if so, how does it handle characters such as "l" and "M")?

Thanks for your consideration.

Graphics / Re: Highlighting Text
« on: January 02, 2015, 10:03:16 pm »
Interesting suggestion!  Overlaying a material does sound much easier than aligning 3 Text instances.

I haven't worked with SFML shaders, but I'll read up its documentation.  I'll let you know what I find, or if I have additional questions.

Graphics / Highlighting Text
« on: January 02, 2015, 03:25:45 am »

I'm designing a text field where the user can position a cursor in a middle of a text field, and select chunks of text to copy or overwrite the selected text.

One of my concerns with my plans is rendering the highlighted text.  A solution I thought of is having 3 instanced sf::Text (One Text contains the text before the highlight, the second contains the highlighted text with inverted colors, and the third is the text after the highlighted part).  Then I'll was thinking about drawing rectangles (one for each selected line) to represent the highlighted part.

This method sounds slower than it needs to be, and it seems strange to pass characters from one Text instance to another whenever the user is dragging the mouse.  I was curious if there was a better way of doing this.  Does this seem to be the right approach?

General / Re: Error Handling
« on: September 15, 2014, 06:32:48 am »
Thank you for the information.

I'll settle for the redirect solution for the time being.  I'll apply the exception solution when it's ready.  I'm looking forward to SFML 3!

General / Error Handling
« on: September 10, 2014, 07:08:23 am »
I was curious about the error handling system for SFML.  For example, SFML may be unable to import an image if an artist specifies incorrect parameters.  When that happens, I would like to display a meaningful message to them.  I did read an old post about this topic...

I am curious if there are any news about error handling since that post.  If not, are there any plans for displaying error messages?

Thanks for the support!


Graphics / Re: sf::Text::getText Heap Crash
« on: July 19, 2014, 06:19:27 am »
Although I'm happy that I've found the solution, I'm also disappointed that it was something minor.  Here's what my configuration manager looked like when I've revisited it.  My Release build was correct, but Debug was not set correctly (see attachment in what I saw).

I apologies for the false alarm.

Graphics / Re: sf::Text::getText Heap Crash
« on: July 18, 2014, 08:07:33 am »
That's one of the problems I've suspected earlier.  A couple days ago, I've compiled SFML using CMake, and I was still running into this heap crash.  I've decided to post about my attempt in using the stable version to reduce the number of variables.

Today, I've started over in case I've done something wrong last time I've compiled SFML.  I'm not sure what I have done wrong last time, but I'm relieved to find out that I was able to launch my TextTest solution in debug mode.

My main project is still encountering the heap crash, but I haven't done enough investigation to find the culprit.  I'll continue tomorrow.

Graphics / sf::Text::getText Heap Crash
« on: July 17, 2014, 05:57:04 am »

I've spent the last few days investigating this crash, but I'm finding myself traveling in circles now.
I'm running into a heap crash when I call sf::Text::getText()
std::string stdString = text.getString();

Here's the crash message I'm running into:
Program: ...s\visual studio 2013\Projects\TextTest\x64\Debug\TextTest.exe
File: f:\dd\vctools\crt\crtw32\misc\dbgheap.c
Line: 1424

Expression: _pFirstBlock == pHead

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)

I'm using Visual Studio 2013 Express.
This crash only occurs in debug.
This happens in 32bit and 64bit.
I'm using the latest stable version SFML 2.1 for Visual Studio 2012 64bit.

#include <SFML/Graphics.hpp>

int main()
        sf::Font font;
        if (!font.loadFromFile("TheanoModern-Regular.ttf"))
                return 0;

    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");

        sf::Text text;
        text.setString(L"Hello World.\0");
        std::string stdString = text.getString(); //crashes here

    while (window.isOpen())
        sf::Event event;
        while (window.pollEvent(event))
            if (event.type == sf::Event::Closed)


    return 0;

Let me know if you need any further information.
Thank you in advance for your help!

Pages: 1 [2]