Closer to actually editing
All checks were successful
Build Dusk / build-linux (push) Successful in 50s
Build Dusk / build-psp (push) Successful in 59s

This commit is contained in:
2025-11-16 10:40:20 -06:00
parent 7c194ab4b4
commit cf59989167
10 changed files with 306 additions and 120 deletions

View File

@@ -3,8 +3,8 @@ from PyQt5.QtWidgets import QOpenGLWidget
from OpenGL.GL import *
from OpenGL.GLU import *
from editortool.map.selectbox import drawSelectBox
from editortool.map.tile import drawTile
from editortool.map.camera import setupCamera
from editortool.map.camera import Camera
from editortool.map.grid import Grid
class GLWidget(QOpenGLWidget):
def __init__(self, parent=None):
@@ -12,6 +12,8 @@ class GLWidget(QOpenGLWidget):
self.timer = QTimer(self)
self.timer.timeout.connect(self.update)
self.timer.start(16) # ~60 FPS
self.camera = Camera()
self.grid = Grid()
def initializeGL(self):
glClearColor(0.392, 0.584, 0.929, 1.0)
@@ -20,7 +22,6 @@ class GLWidget(QOpenGLWidget):
def resizeGL(self, w, h):
pass
def paintGL(self):
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
@@ -33,8 +34,7 @@ class GLWidget(QOpenGLWidget):
w = 1
glViewport(0, 0, w, h)
setupCamera(self.width(), self.height()) # <-- Add this here
self.camera.setup(w, h)
# Draw test quad at 0,0,0 to 1,1,0
drawTile(0, 0, 0)
drawSelectBox(0, 0, 0)
self.grid.draw()
drawSelectBox()