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

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Can you integrate allegro into an sfml window?
« Last post by Me-Myself-And-I on May 27, 2024, 08:25:22 pm »
Thankyou very much! It works fine! ;D
2
General / Re: error during initialisation of SFML
« Last post by eXpl0it3r on May 27, 2024, 02:09:15 pm »
Just in case someone finds this post or the original poster checks again.

Those kinds of errors are usually an indication that a wrong runtime library was used.
Runtime libraries have to match 100% between that one used with SFML and then one that gets linked into your application.
This means, one needs to make sure to use the exact same compiler version (not just GCC version, but the whole configuration!). Or even simpler, build SFML with your compiler, that guarantees it matches. See also the SFML CMake Template.
3
The application needs the permission, not the terminal or XCode as far as I know.
If you recompile or change the application name, the permission might be removed, but I'm not sure how macOS hands this out.

Either way, I still highly recommend to track keyboard states via events.
4
I did give permission to both XCode and Terminal; however, it still doesn't work. What's even weirder is that I didn't change the permission settings ever. Keyboard just worked one day and didn't the next.
5
On macOS in order to use sf::Keyboard::isKeyPressed you'll need to give monitoring permission to the application.
Alternatively, you can use the KeyPressed event that doesn't need any additional permission.
6
Graphics / Re: How to draw object with position relative to another object?
« Last post by eXpl0it3r on May 27, 2024, 07:57:57 am »
If you moved it inside the player, then you can draw the hitpoint inside the player's Draw call and apply the transformation there.
At some point, you need to have code that says it's relative to X ;D
7
Graphics / Re: How to draw object with position relative to another object?
« Last post by smurf on May 27, 2024, 05:35:58 am »
Thanks for this!
Its better than what I had for sure.
I made a small improvement by moving the hitpoint object into the player which makes more sense to me.
Unfortunately something still seems a bit inelegant about it, specifically having to pass the new RenderStates() thing to the draw call. But I guess there is no way to make this implicit.
Anyway thanks again!
8
As the title states, Keyboard::isKeyPressed is not working. To demonstrate this issue, I created a simple project to show that it does not work:

#include <iostream>
#include "SFML/Graphics.hpp"
#include "SFML/Window.hpp"
using namespace std;
using namespace sf;

RenderWindow window(VideoMode(1400, 840), "Game Window");

int main(){
    while(window.isOpen()){
        Event event;
       
        if(Keyboard::isKeyPressed(Keyboard::A)){
            cout << &#39;e&#39; << endl;
        }
        while (window.pollEvent(event)){
            if (event.type == Event::Closed){
                window.close();
            }
        }
    }
}

Even if I pressed A, nothing gets outputted.

Some additional information, I code in XCode on Mac; however, I can't run SFML directly from XCode. Instead, I downloaded SFML through homebrew and ran the code through Terminal. I don't know if this affects the code (it didn't affect it previously) but I figured I might add it.
9
General / Re: Can you integrate allegro into an sfml window?
« Last post by fallahn on May 26, 2024, 11:43:02 am »
Based on your earlier post I assume you're using Dev C++ in which case check their FAQ: https://bloodshed.net/FAQ#9

Else if you're using CMake use the FindOpenGL command https://cmake.org/cmake/help/latest/module/FindOpenGL.html

Or in Visual Studio add "opengl32.lib" to the library list in the project properties and it'll find the file automatically.
10
SFML development / Re: Font/Text Direction
« Last post by eXpl0it3r on May 26, 2024, 12:13:40 am »
If you want to PR that change, I'm sure we'd accept it for SFML 3.

My question was more, whether that on its own is really enough/useful if you do want to create your own custom text with vertical layout, or whether one would also need other adjustments.
Pages: [1] 2 3 ... 10
anything