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

Pages: [1]
1
General / Re: Linux distribution
« on: September 28, 2020, 11:30:51 pm »
this is really helpful, thanks!

2
General / Re: Linux distribution
« on: September 25, 2020, 04:37:26 am »
ok, so apparently my problem was that I used a USB stick formatted for windows to transfer the file, and it lost the user permissions information. stuck the Pi's sd card into my ubuntu and transferred it that way instead. now it no longer complains, but now I tell it to launch and nothing happens. is SFML compatible with Rpi?

3
General / Linux distribution
« on: September 25, 2020, 03:36:51 am »
I'm used to using SFML on Windows, but I wanted to try it with Linux. my Linux understanding is quite small though. I got SFML installed, using Codeblocks, and compiled a test script (the one with the green circle from the tutorials) and in the release folder, I have the compiled file, as I wished for. (I think it's an elf file? there's no file extension) I can run this file on this machine by using cd to enter the file path, then entering "./filename" to launch the program. that's all fine and dandy, but I took that file, and threw it onto my other linux computer (the latest Raspberry pi) but it simply says "permission denied". I tried this with sudo su as well, same result. I expected it to at least complain that I didn't include the SFML .DLLS, but it doesn't want to run it at all. if it doesn't work on Pi, then ok that's fair. but it's not giving me an error, it's just telling me no. how are you supposed to distribute your linux compiled game? been googling, can't find any proper tutorials, I probably just don't know the right search terms. thanks!

4
Window / local mouse position
« on: May 02, 2020, 03:01:10 am »
so my window is 480x360, making a pixel-style game. just told a sprite to be my new mouse pointer, and hiding the real pointer. this works fine, until I hit the fullscreen button. then the mouse coordinates aren't correct anymore. it's figured out that x0y0 has moved, but the coordinates I'm getting are assuming the screen is still 480x360.

here's all the code that matters to give ya, everything other than the local mouse position is working fine.

sf::RenderWindow window(sf::VideoMode(480, 360), "Hello");

mPos.x = sf::Mouse::getPosition(mainWindow).x;
mPos.y = sf::Mouse::getPosition(mainWindow).y;
    UIsprite.setPosition({mPos.x,mPos.y});
    mainWindow.draw(UIsprite);
    std::cout << mPos.x << "~" << mPos.y << "\n";

5
General / close console at the same time as window?
« on: April 25, 2020, 11:30:59 pm »
so I've got my program working with a console (for debugging information) and the window (for my game) and I've got the basic outline I've found in tutorials and seen in the forums:

while(mainWindow.isOpen()){
sf::Event event;
while (mainWindow.pollEvent(event)){if (event.type == sf::Event::Closed){
mainWindow.close();
}

but I've added "quitEverything = true;" after "mainWindow.close();" to tell the other threads I'm using to terminate. this is all working as intended.

but when hit X to close the window, I have to go manually close the console as well. I know how to get rid of the console altogether, but I kind of need my debug info.

asking because I can't seem to find anything on forums or Google, can I tell the console to close as well when quitEverything is true?

something like

if (quitEverything){sf::Console::close();}  ? does this exist?

I know I can close the console first and they both close, but I often put the game window fullscreen, so it's mildly annoying to close it and then the console as well.

thanks in advance for answers!



Pages: [1]