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

Pages: [1]
1
General / Re: Sfml to exe
« on: September 21, 2017, 02:01:08 pm »
Everything is correct, before when using cpp, clicking build will build a exe file for me but when using sfml it only creates it for the debug and it doesn't work as it can't find the dlls. I am still able to run it but I want to share it for people who can't open cpp file or doesn't have code blocks, visual studios cpp etc


Sent from my iPhone using Tapatalk

2
General / Sfml to exe
« on: September 21, 2017, 10:27:57 am »
I'm trying to make my cbp file into a exe, so that as long as you have the dlls, images and the audios, you can run it.

Can someone please tell me how to do that??
I'm using Code::Blocks

3
Audio / Making sound replay after it finishes playing
« on: September 19, 2017, 01:03:17 am »
Thanks a lot! With a little bit of adjusting I was able to make my sound slowly fade. I adjusted the speed of it fading so that I can spam without the sound coming too late

I used 3 Booleans and (probably I could manage to use only two, I'll try). If space is pressed a Boolean returns true, it plays music, sets another Boolean to false, then sets itself to false. Once space is released it stops the music and makes that other Boolean true. The music space_pressed Boolean can only return true while the other Boolean is also true, preventing it self switching on then off and again and again.


Sent from my iPhone using Tapatalk

4
Audio / Making sound replay after it finishes playing
« on: September 18, 2017, 02:38:34 am »
So I'm making a jetpack joyride game and I wanted to add some sound.
Currently it plays the sound while you are flying but it replays the sound every frame and it sounds really annoying.

How can I make it replay a sound only after it finishes playing that sound. I will also want it to instantly stop the sound as soon as I release the space bar.

Thank you!


Sent from my iPhone using Tapatalk

5
General / Re: Fps Check every second
« on: September 17, 2017, 02:06:21 am »
Thank you! Works very smoothely


Sent from my iPhone using Tapatalk

6
General / Fps Check every second
« on: September 16, 2017, 12:03:42 pm »
Now currently I have a system that calculates the fps (not 100% accurate but good enough) and out puts it into a txt file.

Now I'm trying to make it output only once a second and/or limit the output so there can only be 100 output inside the text file and deletes older outputs.

I tried many different way to slow down the output  but when I put it on a slower clock the fps becomes something like 0.9. (Which kind of makes sense because it's on a slower clock but)

Thank you for reading, anyways here is my code inside main(). I removed irrelevant code


std::ofstream fpsLog;
fpsLog.open("fps_log.txt");

sf::Clock fpsclock
sf::Time FPSTimer
while (window.isOpen())
{
FPSTimer = fpsclock.getElapsedTime();
fpsLog << 1.0f / FPSTimer.asSeconds();
fpsclock.restart().asSeconds();

}


Sent from my iPhone using Tapatalk

7
Graphics / No SFML view window
« on: September 12, 2017, 01:06:24 am »
Thank you very much!!

I've ran it on debug, didn't seem to work, so I restated everything and finally I got my sfml window. I don't know what was the problem but thank you for helping!!!

Can't seem to change the title to [solved]


Edit:
I think the issue was that the SFML file was in my documents file when my program was in my USB so that it couldn't find it. I changed it so that the SFML file is now inside my USB as well

8
Graphics / Re: No SFML view window
« on: September 10, 2017, 06:10:13 am »
I'm using sfml 2.4.2 and I have minGW in my environmental factor, Path


Sent from my iPhone using Tapatalk

9
Graphics / Re: How Do I change background color of my window?
« on: September 10, 2017, 06:06:33 am »
I don't really know but I assume it's like this
Color(red, green, blue, alpha)

So (255, 0, 0, 255) will make it a bold red maybe??

I've recently just started sfml after learning c++


Sent from my iPhone using Tapatalk

10
Graphics / No SFML view window
« on: September 10, 2017, 06:00:00 am »
So I'm using code blocks to run sfml, and I created a new project with the basic setup using hopson's tutorial.

The example code compiles correctly but no view window pops up

Am I doing something wrong? I edited the build option correctly and pasted all the bin files in my project file. There is no errors in the code as there is no error


11
Graphics / Re: (Render)window won't open
« on: September 09, 2017, 12:49:03 pm »
I also have the same problem. I'm using codeblocks with FCC minGW version of sfml.

It compiles correctly with no error but no view window pop up, only the console (like in normal cpp)


Sent from my iPhone using Tapatalk

Pages: [1]