2
« on: June 27, 2017, 12:55:56 pm »
First of all, Im a super noob to SFML
Im trying to get this heightmap loaded into my SFML project. Its currenly running with glut opengl window. But I could not figure out how to get it into SFML render.
here is my main function
int main()
{
sf::RenderWindow window(sf::VideoMode(600, 600), "OpenGL SFML", GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
window.setFramerateLimit(60);
window.setVerticalSyncEnabled(true);
_terrain = loadTerrain("heightmap.bmp", 15);
sf::Clock Clock;
window.setActive(true);
bool running = true;
while (running)
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
if ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape))
{
window.close();
}
else if (event.type == sf::Event::Resized)
{
// adjust the viewport when the window is resized
glViewport(0, 0, event.size.width, event.size.height);
}
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//window.pushGLStates();
window.draw(drawScene);
//drawScene();
//Terrain.drawScene();
//window.clear(sf::Color::Black);
/*glutDisplayFunc(drawScene);
glutKeyboardFunc(handleKeypress);
glutReshapeFunc(handleResize);
glutTimerFunc(25, update, 0);*/
window.display();
}
I get errors
Error (active) no instance of overloaded function "sf::RenderWindow::draw" matches the argument list Win32Project1 c:\Users\chamara\Documents\MEGAsync Downloads\terrain\Win32Project1\Win32Project1\Main.cpp 326 9
Error C2664 'void sf::RenderTarget::draw(const sf::Vertex *,std::size_t,sf::PrimitiveType,const sf::RenderStates &)': cannot convert argument 1 from 'void (__cdecl *)(void)' to 'const sf::Drawable &' Win32Project1 c:\users\**\documents\terrain\win32project1\win32project1\main.cpp 326 1