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

Pages: [1]
After update to actual Radeon drivers (21.4.1) I have this message when running any SFML program with console.

It's also described by someone on Reddit https://www.reddit.com/r/sfml/comments/lowcus/error_message_on_window_creation/

I have problem with this. On my PC (W10, AMD RX 480) when resolution isn't in supported fullscreen modes and window is fullscreen then sf::Mouse::getPosition(window) return desktop values. If it's windowed it works normally.

For example, when is created window with parameters 1366 x 768 and fullscreen it doesn't work.

Supported video modes:
VideoMode: 1920 1080
VideoMode: 1680 1050
VideoMode: 1600 900
VideoMode: 1280 1024
VideoMode: 1280 720
VideoMode: 1024 768
VideoMode: 800 600
VideoMode: 720 400
VideoMode: 640 480

// Game.h
class Game
        sf::RenderWindow window;

// Game.cpp
        std::vector<sf::VideoMode> supportedVideoModes;
        supportedVideoModes = sf::VideoMode::getFullscreenModes();
        for (auto it : supportedVideoModes)
                std::cout << "VideoMode: " << it.width << " " << it.height << std::endl;

        window.create(sf::VideoMode(1366, 768), "SFML", true ? sf::Style::Fullscreen : sf::Style::Close);

        std::cout << sf::Mouse::getPosition(window).x << ", " << sf::Mouse::getPosition(window).y << std::endl;

Feature requests / Use premake instead of cmake
« on: June 18, 2020, 01:09:51 am »
SFML compilation is not user friendly with current rocket scientist manual. Isn't possible to use premake for example instead of CMake for future versions? It's simple, readable, easily configurable, no problems with project structure, dependency or multiple projects in solution etc.

It should be 2 bulletproof tasks:
1) Download SFML repository (premake binary can be included there) with all needed 3rd party repositories by single command
2) Generate project/solution/whatever via batch file (or by equivalent script)

DotNet / New project from scratch (VS 2019)
« on: March 02, 2020, 04:44:07 pm »
I don't like automated repo packages like NuGet much, it can be old etc.

Then I did this:
1) Download SFML NET and CSFML packages from https://www.sfml-dev.org/
- remove "-2" from CSFML*-2.dll filenames

2) New project in VS 2019 - Console App (.NET Core)

3) Add CSFML dll's to project
- right click on "Project name" in Solution Explorer
- add/Existing files - select CSFML*.dll files and openal32.dll
- select these dll's and in Solution Explorer + right click on "Properties"
- select "Copy if newer" in "Copy to output directory"

4) Use SFML NET source files
- right click on "Solution" in Solution Explorer
- add/Existing Project../ and add all System/Window/.. *.csproj SFML NET 2.5 directory
- right click on "Project" in Solution Explorer/Add/Reference../Projects/ select all SFML.* projects

It works but there is still NuGet SFML Net package thanks to added projects in solution. In output it generate "runtimes" folder with libraries. Is there any way how to get rid NuGet package of it?


Because step 4. creates various strange things, is better add reference to SFML dll's instead. Not sure if there is any difference between lib builds (debug and realease), whereas it is just an interface.

SFML projects / Ludum Dare 40 - Master Farmer
« on: December 05, 2017, 12:31:04 pm »
Well, here is my first entry for Ludum Dare. It was fun and little bit hectic. Game itself is not great miracle but every finished project counts :)


Uses CSFML + Pascal bindings.

Have fun.

Graphics / [Solved] Sprites and shadow overlapping
« on: June 13, 2017, 01:35:57 pm »

I have game sprites with shadows like this: (1x texture / 4x sprites)

And during rendering there is classic problem:

I tried combinations for blending in sf::BlendMode - factor and equation, also without changing alpha color or so but without any results. Is possible solve it simply with blendmode or shaders are needed?

Code for drawing sprites:
procedure spr_Draw_Alpha( renderWindow : PsfrenderWindow; sprite : PsfSprite; x, y : single; alpha : byte; RenderStates : PsfRenderStates = nil );
    pos    : sfVector2f;
    color  : sfColor;
  if not Assigned( sprite ) then exit;

  pos.x := x;
  pos.y := y;

  color.A := Alpha;

  sfSprite_setColor( sprite, Color );
  sfSprite_setPosition( sprite, pos );
  sfRenderWindow_drawSprite( renderWindow, sprite, RenderStates );

Pages: [1]