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

Pages: 1 ... 7 8 [9] 10 11 ... 13
121
System / Using threads to load stuff
« on: September 08, 2011, 04:52:05 pm »
Passing it to the function as a reference didnt work, but using a global variable did

122
System / Using threads to load stuff
« on: September 08, 2011, 10:56:13 am »
Why do you have

loadingThread.Wait();

123
System / Using threads to load stuff
« on: September 07, 2011, 09:18:10 pm »
so

Code: [Select]
bool threadRunning = false;

void loadFiles()
{
 threadRunning = true
    ...
 threadRunning = false
}

sf::Thread loadingThread( &loadFiles);
loadingThread.Launch();

while( threadRunning)
{
    Animate and draw loading screen
}

124
System / Using threads to load stuff
« on: September 07, 2011, 08:49:42 pm »
I want to use a thread to load all the assets and while this is happening animate a loading screen.

The way I thoughht I would do it is:

Code: [Select]

void loadFiles()
{
    ...
}

sf::Thread loadingThread( &loadFiles);
loadingThread.Launch();

while(loadingThread.isRunning)
{
    Animate and draw loading screen
}


The problem is that there is no way to find out if the thread is still running, it there any way to do this?

125
Graphics / Speeding up rendering
« on: September 05, 2011, 09:40:57 pm »
Once the new drawing API is finished for SFML2 then it should all go much faster, not sure ow much more laurent has untill its finished, hopefuly he can give us a hint?

126
Graphics / Weird visual glitches after latest SFML2-port
« on: September 05, 2011, 02:41:05 pm »
This used to happen when having smooth images set and using a tile set, might be your case
Try disableing image smoothing

127
SFML website / Finishing github tutorials
« on: September 05, 2011, 01:23:48 pm »
Hi, just wanted to know if there are any plans to finish the tutorials on github

mainly the
Loading images in a thread (and displaying progress)
and
Stock all your resources in a single DAT file

128
General / How to create a simple Enemy class?
« on: September 04, 2011, 08:16:54 pm »
Just have an update methos, and a draw method.
each called in their resective areas

129
Graphics / Game crashes on Display
« on: September 02, 2011, 01:42:38 am »
Hmm, not sure if that worked or not as implementing the drawing before setting te origin created a different bug, however making a pointer to the menu class instead of not using a pointer has fixed everything.

Might be worth looking at tho

130
Graphics / Game crashes on Display
« on: September 02, 2011, 01:31:46 am »
It seems text needs to be drawned before you can use getRect

131
Graphics / Game crashes on Display
« on: September 01, 2011, 07:21:54 pm »
Its when I  use st::Text::GetRect() that it breaks, dont know why as this shouldnt affect the drawing part

132
Graphics / Game crashes on Display
« on: September 01, 2011, 07:14:56 pm »
Figured out its to do with when I set the origin of the text
I think i do it right but im not sure

Code: [Select]

TitleText.SetOrigin(TitleText.GetRect().Width / 2, TitleText.GetRect().Height / 2);
    NewGameText.SetOrigin(NewGameText.GetRect().Width / 2, NewGameText.GetRect().Height / 2);
    OptionsText.SetOrigin(OptionsText.GetRect().Width / 2, OptionsText.GetRect().Height / 2);
    QuitText.SetOrigin(QuitText.GetRect().Width / 2, QuitText.GetRect().Height / 2);

133
Graphics / Game crashes on Display
« on: September 01, 2011, 05:54:48 pm »
So after the last thread in which I was having an error with openGL I have starte to use just SFML and 2D
But now its breaking with this.

I have
Code: [Select]

std::cout << "draw sfml" << loop << std::endl;
            Game::DrawSFML();
std::cout << "display" << loop << std::endl;
            // Display window contents on screen
            App.Display();
            std::cout << "end" << loop << std::endl;

            loop++;


which gives

sqwitch0
menu0
draw sfml0
display0
[richy@fedoraLt Release]$

Im going to look through the SFMl source and my code to check if i have maybe created the window incorrectly

134
Graphics / Textures and RenderTextures broken
« on: August 31, 2011, 08:24:26 pm »
Just tried using valgrind thought this might give some more details about the porblem

Code: [Select]
==6759== Conditional jump or move depends on uninitialised value(s)
==6759==    at 0x4049DFA: sf::Renderer::SetShader(sf::Shader const*) (in /usr/local/lib/libsfml-graphics.so.2.0)
==6759==    by 0x4395FFFF: ???
==6759==
==6759== Conditional jump or move depends on uninitialised value(s)
==6759==    at 0x4049C28: sf::Renderer::SetBlendMode(sf::Blend::Mode) (in /usr/local/lib/libsfml-graphics.so.2.0)
==6759==    by 0x4395FFFF: ???
==6759==
==6759== Conditional jump or move depends on uninitialised value(s)
==6759==    at 0x4049D48: sf::Renderer::SetTexture(sf::Texture const*) (in /usr/local/lib/libsfml-graphics.so.2.0)
==6759==    by 0x404F191: sf::Sprite::Render(sf::RenderTarget&, sf::Renderer&) const (in /usr/local/lib/libsfml-graphics.so.2.0)
==6759==    by 0x4033F57: sf::Drawable::Draw(sf::RenderTarget&, sf::Renderer&) const (in /usr/local/lib/libsfml-graphics.so.2.0)
==6759==    by 0x4395FFFF: ???


Seems this is the problem, just tried something and it crashed with any drawable not just textures/sprites

135
Window / Hoow do I set the position/other stuff before creation?
« on: August 30, 2011, 05:53:48 pm »
Basically I currently use

Code: [Select]
Game::isOpenGLSetup = Game::setupOpenGL();
    App.SetFramerateLimit(GlobalSettings::globalSettings.getFrameRateLimit() );
    App.ShowMouseCursor(false);

    sf::VideoMode desktopVM = sf::VideoMode::GetDesktopMode();
    App.SetPosition( (desktopVM.Width/2.0) - (App.GetWidth()/2.0) , (desktopVM.Height/2.0) - (App.GetHeight()/2.0)  );

    smView = sf::Vector2i(800,600 );
    winView = sf::Vector2i(GlobalSettings::globalSettings.getWinWidth() , GlobalSettings::globalSettings.getWinHeight() );

    App.Show(true);


Where App.create... gets called in setupOpenGL() but this means that the window shows and then after moves looking a bit ugly.
But if I set it before create then it doesnt do anything.
Im not sure if calling create resets all the values or something

Pages: 1 ... 7 8 [9] 10 11 ... 13