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

Pages: [1]
1
Graphics / Re: [solved]Can't load font file while my CWD is right
« on: February 28, 2017, 10:53:52 am »
Didn't noticed that debug libs are suffixed with "-d", now it works well.

2
Graphics / Re: Can't load font file while my CWD is right
« on: February 28, 2017, 10:13:46 am »
I found the answer at github, It seems I've mixed debug and release libs. But I don't know that at all. So where's the debug version libs? Do I need that?

3
Graphics / [Solved]Can't load font file while my CWD is right
« on: February 28, 2017, 08:39:40 am »
I've checked the working directory of my project(VS2015) and my font file is there, but the program still can't load it correctly. Informations in console are unreadable, maybe because of the encoding of my system. But, it seems their are some characters at the path string's head.

I'm sure that other parts of my code are correct, because when I commented font.loadFromFile() function call, the program works well.

here is the code:
#include <SFML/Graphics.hpp>
#include <imgui.h>
#include <imgui-SFML.h>
#include <SFML/System/Clock.hpp>


int main()
{
        sf::RenderWindow window(sf::VideoMode(1024, 768), "SFML works!", sf::Style::Default);
        window.setVerticalSyncEnabled(true);
        // &#32465;&#23450;ImGui
        ImGui::SFML::Init(window);

        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);

        // &#35835;&#21462;&#23383;&#20307;
        sf::Font font;
        font.loadFromFile("arial.ttf");


        sf::Clock deltaClock;
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        // ImGui&#22788;&#29702;&#20107;&#20214;
                        ImGui::SFML::ProcessEvent(event);
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                ImGui::SFML::Update(window, deltaClock.restart());
                //ImGui::ShowTestWindow();
                ImGui::Begin("test window 1");
                ImGui::Button("Look at this pretty button");
                ImGui::End();
                ImGui::Begin("test2");
                ImGui::Button("button");
                ImGui::End();

                window.clear(sf::Color(70, 120, 150));
                window.draw(shape);
                //window.draw(text);
                ImGui::Render();
                window.display();
        }
        ImGui::SFML::Shutdown();
        return 0;
}

 








4
SFML website / Re: Can I help to translate the tutorial into Chinese?
« on: February 28, 2017, 06:41:30 am »
No, we don't want to publish other translations on the website, because of future maintenance issues. However you can publish your translation on another website.
Got it. Thanks for reply :)

5
SFML website / Can I help to translate the tutorial into Chinese?
« on: February 28, 2017, 05:28:31 am »
I noticed that the tutorial on official website has a French translation. Can I help to make a Chinese one? :)

Pages: [1]
anything