Welcome, Guest. Please login or register. Did you miss your activation email?

Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Window / Re: Restart Window inside isOpen loop
« Last post by eXpl0it3r on April 12, 2024, 06:45:08 pm »
If you close and directly re-create the window, you won't just drop out of the loop, but by the time you hit the while condition again, it will already be reported as open again, so you won't leave the loop :)
12
Window / Restart Window inside isOpen loop
« Last post by schlepper_64bit on April 12, 2024, 04:59:56 pm »
Hello,
I was wondering if it's possible to close and reopen/restart a game window through an event poll inside its while(isOpen()) loop. Anything I attempt just results in closing the window, as that seems to make anything after it in accessible.
13
General / Raycast failed
« Last post by R4nd0mP3rSon on April 12, 2024, 02:36:41 pm »
How do I fixed this https://pastebin.com/8qTAdy95 the code worked fine if I  put      float shape_height = round(1000.f* projection  /rad);        but when I put           float shape_height = round(1000.f* projection  /(rad * dist));    like from this video   it worked  for horizontal  but  not for vertical for some reason




basically the height is a it too tall
14
General / Re: Cmake build issues: linker cannot find -loptimized and -ldebug
« Last post by Kraken on April 10, 2024, 07:45:10 pm »
After some experimentation, a clean make only works sometimes. I can find no consistent reason, but this error continues to appear. Sometimes after a successful build I will rebuild and it will break again. I think this might have something to do with Vscode's default cmake commands.
15
General / Re: Ray go through wall
« Last post by R4nd0mP3rSon on April 10, 2024, 03:52:15 pm »
nvm I fixed it the triangle fan fov[1] was wrong
16
Quote
Do you want to reuse the textures or just save it to disk?

I want to reuse them: show the user the render result and, if it is satisfactory, the user can then save it. Thank you for your advice about asynchronous saving. I have taken note of it.
Thank you very much for your help  ;) !
17
General / Re: Cmake build issues: linker cannot find -loptimized and -ldebug
« Last post by eXpl0it3r on April 10, 2024, 08:29:58 am »
"optimized" and "debug" have to be provided as link targets from somewhere, might just be cached.

Make sure to clean your build directory and do a clean CMake configure again.
18
General discussions / Re: How to render to RenderTexture with std::async safely?
« Last post by eXpl0it3r on April 10, 2024, 08:26:43 am »
I believe the primary slow down of things are currently the multiple copies of textures you're doing (explicitly and implicitly). If you reduce that, it should probably be possible to do it in the main loop with minimal lag.

Do you want to reuse the textures or just save it to disk?

If you just want to render some images to disk, I suggest to not first render all the textures and then save it, but to get the RenderTexture's texture, save that, then render the next one. This will remove the copying of the RenderTexture's texture into another texture instance and also remove the need for a storage container.
What you then could consider, is moving the texture data into memory first, then use std::async to write the data from RAM to disk async, to not block on slow IO operations.

If you do want to store the texture somehow for reuse, then I'd suggest std::vector<std::unique_ptr<sf::Texture>> as a container. If you use C++17 and above, you should benefit from guaranteed copy elision, as such, you should be able to return the full vector.
I'd suggest to try and spread the rendering across multiple frames, if that's at all possible, so you leave enough frametime for the reset of the loop.
19
General / Cmake build issues: linker cannot find -loptimized and -ldebug
« Last post by Kraken on April 10, 2024, 07:03:42 am »
I have been attempting to build SFML with cmake for integration with my own cmake build system to ensure that it works with any compiler for cross platform development. After messing around with different configurations, I have found a strange problem that I cannot find any solution to.

I am on windows 11, working with MSVC 2019 and Mingw32. To ensure that I am not the source of this error, I am using a fresh clone of https://github.com/SFML/cmake-sfml-project/. Configuring and compiling works fine for both systems, but when linking, I get the same error:

This is the MSVC 2019 error:
LINK : fatal error LNK1104: cannot open file 'optimized.lib'

and this is the Mingw32 error:
x86_64-w64-mingw32/bin/ld.exe: cannot find -loptimized: No such file or directory
x86_64-w64-mingw32/bin/ld.exe: cannot find -ldebug: No such file or directory

I don't think that there is an actual library named debug or optimized that is missing, instead some configuration is messed up somehow.
After some research, the only issue I could find this could be connected to is a way of specifying debug and release linking:

target_link_libraries(${PROJECT_NAME}
    optimized mylib-release
    debug mylib-debug
)

But after some digging, neither the template cmakeLists.txt nor the SFML build cmakeLists.txt includes anything in this format. I'm at a loss for what to do here.
20
General / Re: Why anything after "while (window.pollEvent(Event))" kills framerate ?
« Last post by kojack on April 10, 2024, 12:10:34 am »
A quick calculation shows 1280 x 720 x 250fps means each pixel has only 4ns to be rendered.
Considering a single cpu cycle on a 4GHz cpu is 0.25ns, there's not much head room.
Pages: 1 [2] 3 4 ... 10
anything