local Debug = GameLab.Debug local AssetBrowser = GameLab.Editor.GUI.EditorWindow.Extend("GameLab.Editor.AssetBrowser") local GL = GameLab.Engine.GL local Matrix44 = GameLab.Engine.Math.Matrix44 local Engine = GameLab.Engine local IO = GameLab.IO local inspect = require("inspect") AssetBrowser.Ctor = function(self) self.base.Ctor(self, "AssetBrowser") end local shader = nil local tex AssetBrowser.OnGUI = function(self) if tex == nil then tex = Engine.Resource.LoadTexture("./Resources/Images/brickwall.jpg") end if shader == nil then local glsl = IO.ReadFile("./Resources/Shaders/Editor-Text.glsl", IO.EFileMode.Text) shader = Engine.Rendering.Shader.New(glsl) end local ortho = Matrix44.New() ortho:SetOrtho(0, 400, 400, 0, 0.1, 10) Debug.Log("AssetBrowser.OnGUI()") GL.ClearColor({0.1,0.1,0.1,1}) GL.Clear(GL.EBufferType.ColorBuffer) -- GL.Color({1,1,0,1}) -- GL.LoadPixelMatrix(-250, 250, -300, 300) -- GL.Begin(GL.EPrimitiveType.Triangles) -- GL.Vertex({0,0,-1}) -- GL.Vertex({0,300,-1}) -- GL.Vertex({250,0,-1}) -- GL.End() Engine.Rendering.UseShader(shader) Engine.Rendering.SetMatrix44("gamelab_mat_mvp", ortho) Engine.Rendering.SetTexture("uiTex", tex) Engine.Rendering.DrawUIQuad({10, 30, 300, 300}) Engine.Rendering.ResetUniformState() end AssetBrowser.OnFocus = function(self) end return AssetBrowser