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.


Topics - RaptorIV

Pages: [1]
1
Window / Window.display()
« on: April 12, 2012, 08:34:14 pm »
What does the window.display() function actually do? Does it call glFlush()? Does it swap buffers? (Does SFML window use doube buffering?)

2
Window / Having trouble with threaded opengl calls
« on: March 30, 2012, 07:23:34 pm »
I am trying to make opengl calls to a window from a separate thread than the window is created in. Before calling the thread I call setActive(false) and in the thread I call setActive(true) but the clear color is not applied.

I didn't include my viewport or projection setup, but the code works when I replace drawThread.launch() with the contents of onDraw().

Code: [Select]
Renderer::Renderer()
:    drawThread(&Renderer::onDraw, this)
{}

Renderer::onDraw()
{
    sf::Context glContext; //I have included, excluded, and moved this around but it makes no difference
    m_window->setActive(true);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    m_window->display();
}

Renderer::startDraw()
{
    m_window->setActive(false);
    drawThread.launch();

   
    //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //This works when uncommented
   // m_window->display();
}

int main()
{
    while(window->isOpen()){
        startDraw();
    }
}

This results in "Failed to activate window's the context" spam

3
Window / Framerate drops from 1.6 to 2.0
« on: February 13, 2012, 11:59:35 pm »
I recently updated my game engine with SFML 2.0 and after updating for all the API changes and compiling, I noticed a drastic drop in framerate (Before it was capped at 30fps, not I get 7-9 fps). I've tried commenting large sections of code just to see if it may be causing the framerate drop, but the only thing that makes a difference is if comment my Window.Clear(), Window.Draw() loop, and Window.Display() all together. Just commenting one (I.E. just the Draw loop) doesn't make any change.

The Frame is drawn in a separate thread.

Compiling on Windows 7 64bit (32bit exe)  Intel Core i7-2600k

Any reason why this may be happening?

4
General / SFML 2.0 And Eclipse
« on: February 10, 2012, 01:41:22 am »
Hey guys, so i'm trying to include SFML 2.0 in eclipse and i'm having difficulties. i tired following this forum post  http://www.sfml-dev.org/forum/viewtopic.php?t=2246&sid=d66bad4f51a9782b7cf490e372b46b93  , but with the appropriate filenames and paths, but no luck. i'm getting the issue
Code: [Select]
ld.exe: cannot find -llibsfml-window but it's not just for window, it's for all of them. i've triple checked that my filenames are correct, and my paths, and i've made everything match the forum post.

If you have any idea, please help me out!

Thanks.

5
Graphics / Sprites only drawn once
« on: December 05, 2011, 04:44:38 am »
I wrote a Render handler that draws a sf::Drawable* at certain depths. For some reason if a sprite using the same image as another sprite is in the handler only the first sprite inserted is drawn. Is there anything useful that is not common knowlegdge about sf::Image or sf::Sprite that would stop me from casting them as a Drawable that might cause this?

We have our project up at github, here is the Renderer cpp
https://github.com/b3ngr33ni3r/Magnet/blob/master/OurGame/Renderer.cpp

6
Graphics / RenderWindow.Clear() one sf::Shape?
« on: November 04, 2011, 08:16:55 pm »
Is it possible to remove a single DrawableObject from the render window rather than clear the whole thing every time? Seems inefficient in larger applications

7
Graphics / sf::RenderWindow::Draw() by reference
« on: October 16, 2011, 07:55:22 pm »
So I try to pass an sf::RenderWindow by reference to my class constructor. When I run sf::RenderWindow.Draw(myShape); i get no errors, but nothing appears in the render window.

Code: [Select]

class Board
{
    public:
        Board(sf::RenderWindow &App);
}

Board::Board(sf::RenderWindow &App)
{

    sf::Shape myShape= sf::Shape::Rectangle(0, 0,  100, 100, sf::Color(0, 0, 0));
    App.Draw(myShape);
}

//in main
sf::RenderWindow App(sf::VideoMode::GetMode(0), "Render Window");
Board gameBoard(App);


So how do can I draw to the renderwindow through reference like this?

8
General / Window Generation error with sfml 1.6 and visualStudio2010
« on: October 14, 2011, 04:30:55 am »
when trying to run the following line, linking to the dynamic 1.6 library, after copying the correct dlls to the project directory, using visual studio 2010, the program compiles, then immediately crashes:
Code: [Select]
   sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
i get (from the debugger in VC2010)
Code: [Select]

A buffer overrun has occurred in sfml.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

'sfml.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\detoured.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'sfml.exe': Loaded 'C:\Windows\SysWOW64\ig4icd32.dll', Cannot find or open the PDB file
The thread 'Win32 Thread' (0x200c) has exited with code 0 (0x0).



as near as i can tell all the vc++ and linker input things have been correctly configured, and it builds without a problem, as i previously said. however, still it immediately crashes.

Any help would be MUCH appreciated.[/code]

9
General / Latest GitHub Snapshot - Graphics example doesn't work
« on: October 13, 2011, 09:55:47 pm »
Hello all,

I recently downloaded and successfully built the latest version of SFML from github but when I try to run the example graphics program (from the tutorials) it fails with the following errors.

Code: [Select]

1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>C:\Projects\SFML\sfml-test\Debug\sfml-test.exe : fatal error LNK1120: 9 unresolved externals


Can anyone help me?

(I'm using Visual Studio 10)

Pages: [1]
anything