Refactor window size, update selection cursor on new screen

This commit is contained in:
2023-03-25 09:27:27 +00:00
parent 20c05be23f
commit ea0c942887
57 changed files with 346 additions and 310 deletions
+9 -8
View File
@@ -48,13 +48,13 @@ doDrawing' win pdata u = do
checkGLError
let w = _uvWorld u
cfig = _uvConfig u
rot = w ^. cWorld . camPos . camRot
camzoom = w ^. cWorld . camPos . camZoom
trans = w ^. cWorld . camPos . camCenter
wins = V2 (_windowX cfig) (_windowY cfig)
rot = w ^. cWorld . cwCamPos . camRot
camzoom = w ^. cWorld . cwCamPos . camZoom
trans = w ^. cWorld . cwCamPos . camCenter
wins = V2 (windowXFloat cfig) (windowYFloat cfig)
(windowPoints, wallSPics, wallsToPoke) = wallsToDraw w
lightPoints = lightsToRender cfig (w ^. cWorld . camPos) (w ^. cWorld . lWorld)
viewFroms@(V2 vfx vfy) = w ^. cWorld . camPos . camViewFrom
lightPoints = lightsToRender cfig (w ^. cWorld . cwCamPos) (w ^. cWorld . lWorld)
viewFroms@(V2 vfx vfy) = w ^. cWorld . cwCamPos . camViewFrom
shadV = _pictureShaders pdata
nFls = w ^. cWorld . numberFloorVerxs
-- bind as much data into vbos as feasible at this point
@@ -116,10 +116,11 @@ doDrawing' win pdata u = do
glEnable GL_BLEND
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
setViewport _graphics_overlay_resolution cfig
glBindBufferBase GL_UNIFORM_BUFFER 0 (pdata ^. orthonormalMatUBO)
glBindBufferBase GL_UNIFORM_BUFFER 0 (pdata ^. matUBO)
withArray (scaleMatrix (2 / windowXFloat cfig) (2 / windowYFloat cfig))
$ \ptr -> glNamedBufferSubData (pdata ^. matUBO) 0 64 ptr
renderLayer FixedCoordLayer shadV layerCounts
-- set the coordinate uniform ready for drawing elements using world coordinates
glBindBufferBase GL_UNIFORM_BUFFER 0 (pdata ^. matUBO)
withArray (perspectiveMatrixb rot camzoom trans wins viewFroms) $ \ptr ->
glNamedBufferSubData (pdata ^. matUBO) 0 64 ptr
renderLayer DebugLayer shadV layerCounts