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?)
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.
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();
}
}
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.
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);
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
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).
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