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

Pages: [1]
1
SFML projects / Re: American Football
« on: December 03, 2020, 05:35:33 pm »
Really cool project !!
Looks fun.

2
SFML projects / Raycasting engine / (future dungeon crawler)
« on: December 03, 2020, 05:12:12 pm »
Hey all...
Started messing around with SFML again last month and trying to build an old-school raycasting engine for a prototype of a dungeon crawler game i want to make.

Right now i'm just testing features and adding stuff, trying to see how much i can push it.
I've started looking at BSP but probably won't be implementing it as grid based dungeon crawlers don't really need to be that complex.

Here's a small vid of animated textures in my current version:



For the specifics: C++/SFML of course and a 1152x864 view on a 1920x1080 window.
I do have several options (i can reduce the res to 320x240 or 640x480 which then get zoomed in by the view and produce much higher FPS obviously).

Things i want to add next: sprites (objects/npc/monsters), skybox, higher walls.

3
Graphics / Re: Correct method for drawing stuff in the window
« on: November 24, 2020, 03:46:51 pm »
Found the issue, i just forgot to multiply the index by 4 which resulted in the weird behavior.
Thanks again !

4
Graphics / Re: Correct method for drawing stuff in the window
« on: November 24, 2020, 11:20:24 am »
Yes, but then that means the buffer is 4 times bigger than the actual image?
That's what i was doing but it's not working correctly for some reason (i get a small part of the image with 4 times the graphics).
I'll try to figure out what goes wrong since i have the correct logic.
Thanks

5
Graphics / Re: Correct method for drawing stuff in the window
« on: November 23, 2020, 08:57:26 pm »
Having some issues since the uint8_t *buffer needs to be updated with rgba values instead of a sf:color and thus is 4 times as big as the actual image.

Quote
Update a part of the texture from an array of pixels.

The size of the pixel array must match the width and height arguments, and it must contain 32-bits RGBA pixels.

So i'm not quite sure how to do this since the uint8_t can't "contain 32-bits RGBA pixels".

6
Graphics / Re: Correct method for drawing stuff in the window
« on: November 12, 2020, 10:19:25 am »
Hey, thanks for the quick answer !
I'll modify the code and see how it goes ^^

7
Graphics / Correct method for drawing stuff in the window
« on: November 12, 2020, 08:15:39 am »
Hi all !
I've started working with the SFML again after years of not touching it...
So i'm working on a small raycasting engine and was wondering what was the correct method for drawing stuff in the window...
Specifically, i need to access and modify the individual pixels of the image to write the correct color in there and then draw that image on the window.

Additionally, i'd like being able to use only a portion of the screen for that view, no matter the actual resolution of the window (bigger than the play screen which will be either 320x240 or 640x480 for the oldschool feel).

Right now here's how i'm doing things:

buffer is a sf::Image
drawBuffer is a sf::Texture
spriteBuffer is a sf::Sprite

For each pixel on the game screen, i'm setting the color (after getting it from the texture) with
buffer.setPixel(x,y, color);
then when it's done
        drawBuffer.loadFromImage(buffer);
        spriteBuffer.setTexture(drawBuffer);
        window->draw(spriteBuffer);

I'm pretty sure that's not ideal (especially since my basic engine isn't very computation heavy and it's too slow right now) so i'd like to know how to improve this.
Thanks!

Pages: [1]