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

Pages: 1 [2] 3 4 ... 9
16
General / A few questions regarding Android development
« on: November 01, 2014, 07:13:14 pm »
I want to start developing C++ Android applications using SFML.
Unfortunately, I don't have any experience developing apps for the Android platform, so I have a few(a bunch of) questions:
  • Do I have to modify my existent C++ code to compile it for android?
  • What else do I have to include to my project? (Maybe a manifest file?)
  • Can I use sort of an Android API in my C++ project? (For example to get the screen resolution of the device)
  • How do I compile my C++ code?
  • Can I continue using my favorite IDE?

If somebody has the time to answer my questions or just give me a link to a website or forum topic which helps me, I would really appreciate it! :)

17
Graphics / Re: sf::Font size not accurate
« on: October 15, 2014, 09:53:45 pm »
Today I built SFML from the latest GitHub source on my Win7 PC, and It also had the space on top of the text. I guess my problem is solved now, since my code won't provide different results depending on the operating system anymore! :)

18
Graphics / Re: sf::Font size not accurate
« on: October 08, 2014, 08:54:01 pm »
Okay, its not the fault of libsfml-dev.
Today, I installed a fresh Arch Linux (x86_64), and It doesn't work. I built SFML from GitHub master with cmake.
The libraries
extra/freetype2 2.5.3-2
and
extra/libxft 2.3.2-1
were already installed (maybe they are dependencies of cinnamon).

I honestly have no idea what I could do to solve the problem :(

Does somebody have an idea?

19
Graphics / Re: sf::Font size not accurate
« on: September 26, 2014, 05:10:49 pm »
So... what happens if you do exact same, except instead of installing libsfml-dev, you grab the latest GitHub master, build it and install it? If it produces the correct results, then libsfml-dev is bogus.
It works perfectly, theres no space on top. Tested with a fresh Mint VM without updates. After I installed SFML in the usr/local directory, the example program didn't start, and showed me an error message that it couldn't find the SFML library, which is weird, since I linked it statically. Then I installed SFML in the root directory and it worked.
I had libsfml-dev installed  before I built SFML from source on my original system, but removed it before I started building the library (apt-get remove libsfml-dev and apt-get autoremove, I forgot to simply use purge).
So I guess that libsfml-dev was/is causing the error.

20
Graphics / Re: sf::Font size not accurate
« on: September 25, 2014, 10:48:56 pm »
I've set up a VM with Linux Mint, and I'm able to reproduce the problem. I didn't install any updates on the virtual machine, and I only installed the packages cmake-gui, libsfml-dev, codeblocks and g++.
I copied the CB project folder to my wm and compiled the code; it showed me the same results as on my original system.
Now I will build the bugfix branch and try to compile it without code::blocks...

21
Graphics / Re: sf::Font size not accurate
« on: September 25, 2014, 08:42:13 pm »
Okay, so I checked the Sha1 sums of the fonts, they seem to be the same as yours:
2c078150376bc66e2a4a20ffa6bbbe7a5c03e752  Facile Sans.ttf
723ce6489b30fed829e7763db700d50dfc4e26c1  Facile Sans.otf
 
Here is a screenshot of the Synaptic Package Manager, I searched for "libfreetype". It looks like I have the same libfreetype version.

Again, here is the code I used:
#include <SFML/Graphics.hpp>
#include <iostream>

using namespace std;

int main()
{
    sf::RenderWindow window(sf::VideoMode(500, 500), "Example");
    sf::Font font;
    font.loadFromFile("Facile Sans.ttf");
    sf::Text text;
    text.setFont(font);
    text.setPosition(0, 0); // (0, -20) looks good
    text.setCharacterSize(84);
    text.setString("Text");
    text.setColor(sf::Color::Black);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear(sf::Color::White);
        window.draw(text);
        window.display();
    }

    return 0;
}

 
I use the bugfix/font_fix branch of SFML. (https://github.com/SFML/SFML/tree/bugfix/font_fix)

I hope this helps. If you need more information, just ask for it.

22
Graphics / Re: Render special characters from a variable
« on: September 21, 2014, 08:25:44 pm »
Thanks :)
I tried to get the character as a char and then append it to a std::string at first, but now it works perfect.

23
Graphics / Render special characters from a variable
« on: September 21, 2014, 04:16:32 pm »
I want to render a sf::Text, which contains special characters.
I know that if the text wouldn't be a variable, I could do somenthing like this:
text.setString(L"öüäßê");
But in my case, the text is entered by the user.
How can I render the sf::Text, without having to use a switch statement to check if the character the user entered is a special one?

24
Graphics / Re: sf::Font size not accurate
« on: September 20, 2014, 09:33:23 pm »
Yes, I'm using freetype version 2.5.2.
And I also think that the Linux version is bugged, unless the space on the top is a specific problem of the font. But I'll see how it looks on Windows after the supplied freetype has been updated.

25
Graphics / Re: sf::Font size not accurate
« on: September 20, 2014, 08:24:58 pm »
I found out that the dimensions of the text also are different:
Dimensions on Linux:       left:  0 top:  19  width:  207  height: 65
Dimensions on Windows:  left: -1 top:  -2  width:  209  height: 66
Code used to get the dimensions:
    sf::FloatRect rect = text.getLocalBounds();
    cout << endl << "Width: " << rect.width << " Height: " << rect.height << " Top: " << rect.top << " Left: " << rect.left;

And to achieve the look from windows on linux, I had to set the position of the text to 0, -20 .

26
Graphics / Re: sf::Font size not accurate
« on: September 20, 2014, 10:45:40 am »
I don't use Fedora Linux but Linux Mint 17, which bases on Ubuntu 14.04. Which version of the freetype development files have you installed?

27
Graphics / Re: sf::Font size not accurate
« on: September 19, 2014, 11:57:30 pm »
I uninstalled SFML from my Linux OS and compiled the branch. The git command I used to get the code was
git clone -b bugfix/font_fix --single https://github.com/SFML/SFML.git
I hope this command got me the right repository, I don't know much about git.
The Example Program compiles fine, but the result is still the same  :(
Any other ideas?

28
Graphics / sf::Font size not accurate
« on: September 19, 2014, 06:00:19 pm »
Hey guys! It has been a while since I have been around on the forum. But now I'm back with a question:

I recently have been developing stuff under Linux. When I was working with Fonts, I noticed that the font size isn't accurate; I had to move the font to achieve what I wanted. Then I compiled the same code under Windows and It looked weird, because the font size was right. I also noticed that this doesn't happen with every font.

Example:
I compiled the following code under both operating systems(I used the font facile sans):
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(500, 500), "Example");
    sf::Font font;
    font.loadFromFile("font.ttf");
    sf::Text text;
    text.setFont(font);
    text.setPosition(0, 0);
    text.setCharacterSize(84);
    text.setString("Text");
    text.setColor(sf::Color::Black);
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear(sf::Color::White);
        window.draw(text);
        window.display();
    }

    return 0;
}
 

This is how it looks under Linux:


Under Windows:


Does anyone know why this happens and how to fix it?
I appreciate any help :)

29
General discussions / Re: The new SFML team
« on: April 22, 2014, 12:02:34 pm »
Great news!
I'm sure SFML will grow faster now  :)

30
Graphics / Re: Collision Response doesn't work properly
« on: March 31, 2014, 07:23:43 pm »
Apart from the fact that this question doesn't have much to do with my problem:
Yes, my code is based on the one from the tutorial mentioned by Jesper Juhl ;)

Pages: 1 [2] 3 4 ... 9