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

Pages: 1 ... 4 5 [6] 7
76
Window / How to disable user input e.g. keyboard, mouse
« on: January 01, 2012, 04:41:09 pm »
Quote from: "Neomex"
Code: [Select]

if( Enabled )
{
//do input here
}


Ah no, I want SFML NOT to grab anymore system inputs from keyboards. I can hit my mouse and keyboard while the splash screens are cycling and before they are done I will not be at the main menu screen as the inputs have been registered and CECUI uses them and throws me two menus deep or whatever....

77
Window / How to disable user input e.g. keyboard, mouse
« on: January 01, 2012, 07:11:21 am »
I would  like to disable user input until after my splashscreens are done... Anyway to do this?

Thanks!

78
General / SFML 2.0 and Codeblocks
« on: December 30, 2011, 09:22:08 pm »
I am just checking out Codeblocks vs. MSVC++ 2010 and have no experience using GCC but I can't get SFML to work with it so far...

I am guessing that since Codeblocks uses GCC by default, that when it comes to libs I can't use sfml*.lib and I will need to use Codeblocks to compile a new set of libs that end with sfml*.a?

So if that is correct I am guessing the .lib files are tied to MSVC++ platform only?

Thanks!

79
General discussions / FPS calculations with SFML2.0
« on: October 18, 2011, 03:16:20 am »
this is what I currently using and seems to work fine...

Code: [Select]

inline unsigned int GetFrameRate(void)
{
static unsigned int frameCounter = 0;
static unsigned int frameTime = 0;
static unsigned int fps = 0;
frameCounter++;
frameTime += window.GetFrameTime();
if(frameTime >= 1000)
{
fps = frameCounter;
frameCounter = 0;
frameTime -= 1000;
}
return fps;
}

80
System / Using threads to load resources for OpenGL
« on: October 16, 2011, 09:43:59 pm »
Quote from: "Ceylo"
You should have a look at the usage example of sf::Thread : http://www.sfml-dev.org/documentation/2.0/classsf_1_1Thread.php

Edit: uh.. deleted post?


Yeah I think I got it working! SO far so good I think. The only thing is file accessing for my error manager. Each thread that has an error, gets dumped and I would like to save these.

As of now I think which ever thread gets the file stream first dumps and the other threads miss out on writing data. I tried loading the same texture to test and make sure it wouldn't get loaded, and it doesn't but I wanted to dump a message about that texture has already been loaded. I only got one message which I should have had 4.

Thanks! for all the help

81
System / Using threads to load resources for OpenGL
« on: October 16, 2011, 02:59:02 pm »
Thanks for the reply.

Yeah after looking at the example again I was thinking, not sure this is a great example to learn from....

RC = rendering context

All I am trying to do is, start a second thread and have that thread load up textures and put them into OpenGL, where the main thread is moving on and e.g. allows user to interface with the main menu ect... until the resources are loaded.

So am I reading you right? You can have a second window or context in the second thread do all the loading in that one and then when done just call glFlush()? to upload the texture data? Just make sure I call that window active for the second thread and leave the main window active also for the main thread? Because the main thread will be rendering OpenGL commands while this second thread is loading resources.

Thanks!

82
SFML projects / SPARK opensource particle engine with an SFML module
« on: October 16, 2011, 05:02:52 am »
Quote from: "Richy19"
Hi, has this been updated at all to work with SFML 2?


Ditto!

83
System / Using threads to load resources for OpenGL
« on: October 15, 2011, 06:36:09 pm »
I am trying to get this code to work, but having no luck...

http://www.sfml-dev.org/wiki/en/sources/loadimagesinthread.cpp

but says it can't activate the window? IIRC....

I am not sure, but almost thinking it may be easier to have the thread load the data and when back in the main thread just upload the data to OpenGL then?

Reason for that thinking is I need one thread to load resources into OpenGL, and the main thread will still need to display things like GUI, splash screen ect... So is this even possible? As I recall you can only have one OpenGL RC active or available?

Thanks!

84
General discussions / FPS calculations with SFML2.0
« on: October 15, 2011, 02:18:47 pm »
localFrameTime -= 1000;

that concerns me... If the variable is e.g. 1200 you are already 200 milliseconds over 0...

85
General discussions / FPS calculations with SFML2.0
« on: October 15, 2011, 07:23:54 am »
Quote from: "OniLink10"
Your code... doesn't make any sense. The only values you CAN get from it are 1 and 0. To calculate FPS using the new system, you need to calculate the FPS as 1000/time_elapsed. The 1000 comes from the fact that time is measured in milliseconds.


Ok, but I get division by zero errors when I do 1000/elapsedTime

bah here is what I have now...
Code: [Select]

inline unsigned int GetFrameRate(void)
{
static unsigned int frameCounter = 0, fps = 0;
static float nextSecond = 0.0f, prevSecond = 0.0f;
frameCounter++;
nextSecond += window.GetFrameTime() * .001f;
std::cout << nextSecond << std::endl;

if(nextSecond - prevSecond > 1.0f)
{
prevSecond = nextSecond;
fps = frameCounter;
frameCounter = 0;
}
return fps;
}

86
General discussions / FPS calculations with SFML2.0
« on: October 15, 2011, 06:17:29 am »
I know SFML 2.0 moved to unsigned int vs. float but maybe I just lost it, but I can't get my FPS to come out right... I get a 1 now vs. say 60fps

Code: [Select]

inline unsigned int GetFrameRate(void)
{
static unsigned int frameCounter = 0, fps = 0;
static float nextSecond = 0.0f, prevSecond = 0.0f;
frameCounter++;
nextSecond += window.GetFrameTime() * .001f;
std::cout << nextSecond << std::endl;

if(nextSecond - prevSecond > 1.0f)
{
prevSecond = nextSecond;
fps = frameCounter;
frameCounter = 0;
}
return fps;
}

87
Graphics / sf::Image and OpenGL textures
« on: October 14, 2011, 09:53:00 pm »
Quote from: "Nexus"
No, in SFML 1, this is not possible.

SFML 2 introduced the separation between sf::Image (pixel data) and sf::Texture (OpenGL texture).


Thanks Nexus. I will keep this in mind and upgrade to SFML 2.0 when it's out then. Sigh the wait continues....

88
Graphics / sf::Image and OpenGL textures
« on: October 14, 2011, 09:42:02 pm »
I am not sure about this, but from the looks of it, SFML1.6 I don't see anyway to have sf::Image just load a image file and not create a OpenGL texture? I just want to use sf::Image to load the data, and allow me to use the pixel pointer to upload the data to OpenGL so I can create the kind of texture format I would like to use. e.g. mipmapped, compressed ect...

As of now I allow it to go through the whole process and delete itself, but seems like a huge waste of time, and OpenGL has to load/unload a texture right away....

Thanks

89
General discussions / Switched times to Uint32 milliseconds in SFML 2
« on: June 03, 2011, 01:03:29 am »
Quote from: "Nexus"
Quote from: "Mars_999"
Couldn't we just overload the function? And keep the float version also?
You cannot overload functions if their signature (name and parameters) is the same. At sf::Clock::GetElapsedTime(), only the return value was changed, not the signature.

The only option would be a function with another name, for example GetElapsedSeconds() and GetElapsedMilliseconds().


My bad for not looking at the function ahead of time. I assumed we sent in a parameter... How about a template class then....

90
General discussions / Switched times to Uint32 milliseconds in SFML 2
« on: June 02, 2011, 10:41:41 pm »
Quote from: "OniLink10"
Quote from: "Mars_999"
Quote from: "OniLink10"
50 days of insignificantly less accurate instead of approx 2 hours of insignificantly more accurate? Sounds good to me!


Ha, you never played WOW, EVERCRACK, or BC2 :) Sleep what's that?
I used to play WoW. Never got addicted. Never saw what was addicting about it. In fact, it bored me.
Your point is?


My point is you are apparently not one of 11+million users who are. So you aren't the norm.

Either way the main point is some games run more than a day I seen some friends who let their computers sit there and run as there was no save function vs. going through the game again, and it sat there for days....

OH BTW I have not played WOW, EVERCRACK, but BC2 ahhhh yes good times!

Couldn't we just overload the function? And keep the float version also? Not sure what harm that would do....

Pages: 1 ... 4 5 [6] 7
anything