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

Pages: 1 [2] 3
16
General / Re: Visual Studio 2017 and SFML 2.5.0
« on: May 21, 2018, 05:28:13 am »
Thanks, now the build does not generate any more error, but when running the program it requires that I copy all the DLLs from C:\ SFML-2.5.0\bin to the folder of my compiled .exe (ConsoleApplication2\Debug).
I did not want to ever have to do this.
How can I generate an .exe without ever having to copy the dlls to the project folder?

17
General / Re: Visual Studio 2017 and SFML 2.5.0
« on: May 21, 2018, 01:01:36 am »
Thanks, but could you be clearer?
I do not know what to do. What should I correct exactly?

18
General / Re: Visual Studio 2017 and SFML
« on: May 21, 2018, 12:35:32 am »
Attached some screenshots.

Is something missing?

19
General / [SOLVED] Visual Studio 2017 and SFML 2.5.0
« on: May 20, 2018, 05:18:59 am »
I installed Visual Studio 2017 and downloaded SFML Visual C++ 15 (2017) - 32-bit package.
I do not know if they are compatible, but as I did not find the updated SFML package for Visual Studio 2017, I downloaded this one myself.
I configured it according to the video

... because the https://www.sfml-dev.org/tutorials/2.5/start-vc.php tutorial was not clear about using the files with "-d" end and was not working.
But I used the example code on this page and when compiling I get the errors:
Code: [Select]
1>ConsoleApplication2.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>ConsoleApplication2.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)

My question is whether these errors have to do with some mismatch between the installed versions or if the problem is another.
I wanted to avoid the ordeal that is installing SFML manually.

20
General / Re: What's wrong with this code?
« on: May 16, 2018, 11:18:21 pm »
Thank you.
The problem was all at View initialization.
In your example it would be missing to move the center of the view to the upper right corner, but in fact its solution elucidated the problem.
To homologate the solution, i did  this snippet to fit any background size:

Code: [Select]
View camera;
camera.setSize(Vector2f(background.getSize().x, background.getSize().y));
camera.setCenter(Vector2f(window.getSize()));

21
General / Re: What's wrong with this code?
« on: May 16, 2018, 02:49:37 am »
No answer? Should I think it's a bug? How to get around this?  ???

22
General / Re: What's wrong with this code?
« on: May 14, 2018, 08:07:21 pm »
You're not calling clear on the render texture.

texture.clear() before texture.draw(numeros) in this case makes no difference.

Quote
The view in its current form is not needed.

I think I'll need more in my project, for example, zooming, moving, etc.

Quote
You should make sure that the texture rect for both sprites is correct.

How?

Anyway, I still do not understand why the image only appears in the first quadrant ...




23
General / Re: What's wrong with this code?
« on: May 14, 2018, 07:34:04 pm »
Also don't use using namespace sf;
Why?

24
General / Re: sf::RenderTexture::isRepeated
« on: May 14, 2018, 05:28:25 am »
Of course, thanks!  :)

25
General / [SOLVED] What's wrong with this code?
« on: May 14, 2018, 05:21:56 am »
In the code below, I have the attached image (1000x1000) and I want to show it in a window (500x500) using RenderTexture.
However, only part of the image appears in the first quadrant:



What is wrong?

Code: [Select]
#include <SFML/Graphics.hpp>
using namespace sf;

int main()
{
RenderWindow window({500, 500}, "SFML Views", Style::Close);

View camera;
camera.setSize(Vector2f(window.getSize()));

Texture background;
background.loadFromFile("numeros.png");
Sprite numeros (background);

RenderTexture texture;
texture.create(window.getSize().x, window.getSize().y);

Sprite content;
content.setTexture(texture.getTexture());

texture.draw(numeros);
texture.display();

while (window.isOpen())
{
for (Event event; window.pollEvent(event);)
if (event.type == Event::Closed)
window.close();
window.clear();
window.setView(camera);
window.draw(content);
window.display();
}
return EXIT_SUCCESS;
}

26
General / sf::RenderTexture::isRepeated
« on: May 14, 2018, 03:53:53 am »
I researched but found nowhere.
For what practical purpose there is sf::RenderTexture::isRepeated ?

27
General / Re: Which method is faster?
« on: May 13, 2018, 02:30:06 am »
You are right, thanks.

28
General / How to upgrade SFML from 2.4.2 to 2.5.0 (Codeblocks)?
« on: May 12, 2018, 08:10:00 pm »
I would like to upgrade to version 2.5.0.
But remember that it was not easy to make SFML work with CodeBlocks on my Windows, it was several manual steps.
I would like to know if to upgrade to the new version I would need to do a new full install, or is there any easier way?

29
General / Which method is faster?
« on: May 12, 2018, 05:20:21 pm »
If I will draw a sequence of 1000 rectangles, which would be better (and faster): to have 1 RectangleShape and make 1000 draws, or have an array of 1000 RectangleShapes and make 1 draw?

30
General / Re: Views setcenter vs rotation problem
« on: April 28, 2018, 09:39:55 pm »
Thank you all for your attention and clarification.
In fact I admit that for a beginner in SFML there are missing some important bases, which after learning, everything becomes easier.
With your approaches, now I can better glimpse the solution.
Thank you very much.

Pages: 1 [2] 3