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.


Topics - Faenrir

Pages: [1]
1
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.

2
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]
anything