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

Pages: [1]
1
General / need tutorial for terrian making. [openGL]
« on: June 28, 2017, 06:17:29 am »
Hi everybody. Im the noobest of noobest in this forum. Im trying to get a 3D heightmap done using SFML and OpenGL. For past week or so I tried this retro Glut source code port into SFML but it only did work as 2D in sfml render window  :(

Any SFML based terrian tutorials are there ? Just simple source code to get started with.

thanks

2
General / Glut render to SFML render
« 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   


Pages: [1]
anything