a8c4b05d2f
This commit gets creates the ObjectOriented scene and gets it working. The current test program swaps a triangle from small to large with the 1 and 2 keys on the keyboard. (1 for small and 2 for large). The small triangle is rendered by the simple scene and the large one is rendered by the object oriented one.
39 lines
563 B
C++
39 lines
563 B
C++
#include "MyObjectOrientedScene.h"
|
|
|
|
MyObjectOrientedScene::MyObjectOrientedScene()
|
|
: m_batch(m_triangle)
|
|
{
|
|
}
|
|
|
|
MyObjectOrientedScene::~MyObjectOrientedScene()
|
|
{
|
|
}
|
|
|
|
void MyObjectOrientedScene::init()
|
|
{
|
|
m_batch.init();
|
|
}
|
|
|
|
void MyObjectOrientedScene::use()
|
|
{
|
|
glEnable(GL_DEPTH_TEST);
|
|
glDepthFunc(GL_LESS);
|
|
}
|
|
|
|
void MyObjectOrientedScene::unuse()
|
|
{
|
|
|
|
}
|
|
|
|
void MyObjectOrientedScene::update(float delta_time, clock_t clock)
|
|
{
|
|
|
|
}
|
|
|
|
void MyObjectOrientedScene::render()
|
|
{
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
m_shader_program.use();
|
|
m_batch.render();
|
|
}
|