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

Pages: 1 ... 9 10 [11] 12
151
General / [Solved]Problem Setting up Code::Blocks
« on: October 20, 2010, 01:21:05 pm »
I was being an idiot just then, didn't know where to find the setup manager.

It's in the compiler folder (MinGW). Selected manage installation and changed it to dwarf2.
Thanks for the help, every thing's running smoothly now.

152
General / [Solved]Problem Setting up Code::Blocks
« on: October 19, 2010, 02:32:12 pm »
Anyone?
This only happens when I link to static libs.
But if I use dynamic libs I get the following error:
Quote
The procedure entry point _ZN2sf11SoundBuffer12LoadFromFileERKSs could not be located in the dynamic link library sfml-audio.dll

I have the dll's in the executable's directory.

I just want to compile a simple code but there's so many errors I don't understand.

Thanks in advance.

153
General / [Solved]Problem Setting up Code::Blocks
« on: October 17, 2010, 07:33:27 pm »
Hum, I'm not very familiar with that.
Where can I find the TDM setup?

154
General / [Solved]Problem Setting up Code::Blocks
« on: October 17, 2010, 05:42:54 pm »
I'm pretty new to those terms  :shock: .
What could I do to fix the problem?

155
General / [Solved]Problem Setting up Code::Blocks
« on: October 16, 2010, 01:55:22 am »
Yet again another thread of a problem I couldn't solve for myself... Hope I'm not getting annoying.

I tried to set up SFML on Code::Blocks, following the documentation on the tutorial section but I'm not being very successful.

I think I did everything right, but when I try to compile a simple code using static libraries (I.E. -lsfml-system-s), I get the following:


However, when I use -lsfml-system, it compiles just fine.
What could be wrong?

Thanks in advance

156
General / Capture Enter Key
« on: October 15, 2010, 03:36:35 pm »
Heh I can be so stupid sometimes...

Thank nulloid!  :wink:

157
General / Capture Enter Key
« on: October 15, 2010, 03:27:21 pm »
Hi, I believe this is very simple to do but I'm probably being thick.

How can I capture the enter key, in order to confirm a selection.
I tried App.GetInput().IsKeyDown(Key::Enter) but I that's not correct since Key doesn't have the "Enter" option.

Thanks in advance.

158
General / Thread Priority
« on: October 06, 2010, 09:44:41 pm »
Oops, I was thinking of the wrong file just then.
This is the original code from the screenshot:

Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include <time.h>

using namespace sf;
using namespace std;

//Thread 1
void play_main_menu(void *UserData)
{

    Music Music;
    Music.OpenFromFile("cistern.ogg");
    Music.Play();
    while (Music.GetStatus() == Music::Playing)
    {
        sf::Sleep(0.1f);
    }
}

//Main function
int main()
{
    int geto;
    srand(time(NULL));
    Clock c1;    
    Thread th1(&play_main_menu);    
    th1.Launch();

    Sleep(1.f);
    while(c1.GetElapsedTime()!=0)
    {
        geto = rand() % 256;
        cout << "Main: Aos "  << c1.GetElapsedTime() << " segundos, o programa gerou: " << geto << endl;
        Sleep(1.f);

    }
    return 0;
}

Now if I try to compile it in VS2008 it doesn't make the thread priority "Lowest" like it did before. Now it makes it "Time Critical". There's definitely something wrong with the settings.

When I compile it in VS2010 it sets it to "normal" like it should.
So I know it's not a problem with SFML, but it's on my side.
I'll try reinstalling VS2008.

Thanks for all the help so far!

159
General / Thread Priority
« on: October 06, 2010, 05:31:03 pm »
Quote from: "Laurent"
Are you sure that this particular piece of code produces the result shown on your screenshot above? I just tried and the SFML thread appears to have a normal priority, as expected.

It isn't but the process was the same, I'll post the code as soon as I get home since I don't have the project in this computer.

EDIT @ 4:40pm:
In this computer I have Visual Studio 2010 and I tried compiling the code I posted, and apparently I get normal priority as well. At home I compile with VS2008, that's what I used to compile the original code, thus getting the "lowest priority" issue.
Again, when I get home I'll check this. Could the problem be in VS2008?
I should have tested this before asking...

160
General / Thread Priority
« on: October 06, 2010, 02:59:44 pm »
I did it like this:
Code: [Select]

using namespace sf;
using namespace std;

void thread_tester(void *UserData)
{
cout << "Thread 1 is here." << endl;
/*
Generate random numbers
*/
}


int main()
{
Thread th1(&thread_tester);
th1.Launch();
cout << "Main is here." << endl;
return 0;
}

Used MS Visual Studio 2008 to compile

161
Audio / Failed to load sound buffer from file
« on: October 06, 2010, 05:23:46 am »
It was a problem related to Visual Studio 2008.
I was compiling on debug mode. Changing it to "Release" solved it.

162
General / Thread Priority
« on: October 06, 2010, 05:20:59 am »
Boost.Thread solved my problem as it sets the thread priority to normal by default.

But, imagine I wanted to change it to "High" priority. Not that I'm going to do so, but I'm just curious. I've been reading boost.thread documentation but couldn't find a way to do so, so I did a bit of research and found the function "SetThreadPriority()" but I'm not sure how to use it.

I've tried this:
Code: [Select]
[...]
    thread th1(threadfunction1,n);
    SetThreadPriority(th1, HIGH_PRIORITY_CLASS);
[...]

But I get the error: 'SetThreadPriority' : cannot convert parameter 1 from 'boost::thread' to 'HANDLE'.

What am I doing wrong? Should I be doing this, even? Or is there another way to change the priority of a boost.thread rather than using this function?

I know this isn't related to the topic or to SFML but I just wanted to solve this.

Thanks to everyone for your help


Quote from: "Laurent"

I wish I could get rid of all the stuff in sfml-system -- thread, clock, etc. This has nothing to do with multimedia programming, but unfortunately it's one of the things that you can't avoid, you always need these basic features in this kind of apps.

I found those tools to be very useful, makes the librabry a all in one and it definitely helps those who're just starting, like me hehe.

163
General / Thread Priority
« on: October 04, 2010, 04:15:51 pm »
Ah I see. I understand.
Is there any library for threading that you recommend? Just wondering because asking can save hours of research.

Thanks for your help  :)

164
General / Thread Priority
« on: October 04, 2010, 01:17:58 am »
Hello, once again.
Sorry for creating so many threads in a short amount of time but since I'm on a learning phase, I really want  to solve my questions.

Is there a way to change the priority of a thread?
I noticed all the threads I create are being executed with "Lowest" priority.


On the image, the worker thread plays a music, but since it's running on lowest priority, whenever I do something outside of the application (Open browser, open a folder, open a winrar archive, etc...) the music starts slowing down and skipping.

Is there a way to change this? Or should I stop using SFML thread classes?
Thanks in advance.

165
General / Pass data to a thread function
« on: October 02, 2010, 01:50:36 pm »
Quote from: "Lupinius"
It does actually output the right value for n. You just haven't assigned any value to n, so you get garbage.

Oh sorry, I did do int n=2; on the compiler. I forgot to post it here since I wrote the example from scratch.
It still displays garbage for some reason.

EDIT: Hum, strange. I tried it on a new empty project and now it DOES display n correctly. Not sure why, or what made this happen, but at least it's fixed. But if I try it on the old project it still prints stuff like "0034EDDC", "0045EF9C". Guess I'll stick with a new project. Thanks, for the input.

Pages: 1 ... 9 10 [11] 12