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

Recent Posts

Pages: [1] 2 3 ... 10
1
Graphics / Re: problem with drawing multiple objects
« Last post by iMountDuneed on Today at 12:29:39 am »
oh it was my bad - sorry I was a C++ beginner  - thank you very much for your help
2
Graphics / Massive HELP needed with raycasting code
« Last post by LibertyBear on April 21, 2021, 07:11:24 pm »
I already posted this in the projects board, but I'll post this again here(Where it is labeled as "help").

Im making a simple raycasting module, everything works fine, except object rendering... I can have walls, floors, ceilings, movement, ect... but objects just wont work right.

I based my stuff on this(https://lodev.org/cgtutor/raycasting.html) tutorial and Thomas van der Berg's raycaster.

Here's everything I have: https://github.com/LibertyBear/sfmlTest/blob/main/main.cpp

I really cannot get sprites working, if anybody could help it'd be much appreciated
3
General / Re: Weirdly slow event loop
« Last post by tastyham on April 21, 2021, 06:55:51 pm »
Sounds much more like a coding issue then.

I suggest to create a minimal example or use like SFML's pong example and see if you can reproduce it with that.
If not, then it's more likely an issue in your own code.

I'll try making a code sample for you, but I'm almost certain it isn't. I asked other of my teammates and they don't have issues with what I did.
4
General / Re: makefile error?
« Last post by eXpl0it3r on April 21, 2021, 06:49:11 pm »
You use -I instead of -l (lower-case L)
5
Graphics / Re: Large tile maps with many non-tile-entities, Best Practice?
« Last post by Stauricus on April 21, 2021, 06:43:05 pm »
in my opinion, the best approach is to use VertexArrays to the base tiles. i've used up to 200x200 with no problem at all. more than that, you may want to tear it up in chunks. and all tiles from a VertexArray are drawn at once, just a single draw call. the only downside is that all must have the same single texture source ('tileset').
we have a specific tutorial about tilemaps:
https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php#example-tile-map

for entities, you'll probably want to have a seperate handling. maybe quadtrees ou just divide their positions in chunks (like big imaginary tiles that contains the entities, and are loaded when the player gets close)
6
Graphics / Re: Using SFML should I care about texture binds?
« Last post by eXpl0it3r on April 21, 2021, 05:52:27 pm »
If you use pure-SFML you don't really have to think about binds in that way, as SFML will handle it transparently.

When drawing a VertexArray you need to pass the wanted texture as RenderState to the draw function.
I can't really tell you how the number of textures or size of textures affect your application, best to create custom fitted benchmarks for the use case you intend and check whether it fits your perfromance goal.

Texture atlases are always recommended, because you can then batch more in one vertex array draw call and texture switches aren't necessarily free. Of course with 30GB of texture data, you can't fit that in one texture...

Your GPU won't allow you to have a 20000x20000 texture.
SFML won't display things that are outside the view, but they are still sent to the GPU, which then determines what is and isn't shown. So you do have to take care of what data is sent to the GPU to stay within the availalbe bandwidth.
7
General / Re: makefile error?
« Last post by udaniel on April 21, 2021, 05:42:47 pm »
this is what i see
8
General / Re: Weirdly slow event loop
« Last post by eXpl0it3r on April 21, 2021, 05:38:47 pm »
Sounds much more like a coding issue then.

I suggest to create a minimal example or use like SFML's pong example and see if you can reproduce it with that.
If not, then it's more likely an issue in your own code.
9
General / Re: Entire game in single cpp file?
« Last post by Nexus on April 21, 2021, 05:17:19 pm »
https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
Youtube tutorials are often low-quality and gloss over lots of important topics. C++ is probably the most complex language (at least of those actually used in the industry), it's entirely impossible to learn it in a few days.

That being said, if you want to learn a new language in 2021, I'm not sure if C++ is still the best choice. I would rather recommend Rust (if you want to have the same level of control), which is significantly more modern and easier to use than C++, and does a lot of things better.
10
General / Re: Weirdly slow event loop
« Last post by tastyham on April 21, 2021, 04:42:37 pm »
How do you determine "slowness"?

I would say that the character movement is slower than it should be. More "a"s are printed in the console and the movements (1 pixel / (frame?milisecond?...) is reduced to 0.X pixel.

I just tried using a clock and it does the same thing. Every 10 milisecond I'm checking if my input is WASD, if so I move the sprite X pixels. I stopped using my view and it's doing the same thing.

Here's a gif to see what I mean by "slowness". It's not that easy to see as a gif but look closely when I move my mouse and when I don't.
Pages: [1] 2 3 ... 10
anything