change WorldRenderer to class
This commit is contained in:
@@ -37,11 +37,6 @@ void keyboard_event(GLFWwindow* window, int key, int scancode, int actions, int
|
||||
void mouseCursorEvent(GLFWwindow* window, double xPos, double yPos){
|
||||
static double lastX = xPos;
|
||||
static double lastY = yPos;
|
||||
if(isMouseDown(0)){
|
||||
const float relativeX = (float) (xPos - lastX) / (float) lastWidth * 2;
|
||||
const float relativeY = (float) (yPos - lastY) / (float) lastHeight * 2;
|
||||
td::render::WorldRenderer::moveCam(relativeX, relativeY, aspectRatio);
|
||||
}
|
||||
lastX = xPos;
|
||||
lastY = yPos;
|
||||
}
|
||||
@@ -54,7 +49,7 @@ void windowResizeEvent(GLFWwindow* window, int width, int height){
|
||||
}
|
||||
|
||||
void mouseScroll(GLFWwindow* window, double x, double y){
|
||||
td::render::WorldRenderer::changeZoom(y);
|
||||
|
||||
}
|
||||
|
||||
void registerCallbacks(){
|
||||
@@ -84,7 +79,6 @@ void create() {
|
||||
|
||||
void render() {
|
||||
td::render::Renderer::prepare();
|
||||
td::render::WorldRenderer::render();
|
||||
TowerGui::render();
|
||||
}
|
||||
|
||||
@@ -99,7 +93,6 @@ void update() {
|
||||
|
||||
void destroy() {
|
||||
td::render::Renderer::destroy();
|
||||
td::render::WorldRenderer::destroy();
|
||||
TowerGui::destroy();
|
||||
glfwDestroyWindow(window);
|
||||
window = NULL;
|
||||
@@ -108,7 +101,6 @@ void destroy() {
|
||||
|
||||
void pollEvents() {
|
||||
glfwPollEvents();
|
||||
td::render::WorldRenderer::update();
|
||||
}
|
||||
|
||||
bool isCloseRequested() {
|
||||
|
||||
Reference in New Issue
Block a user