diff --git a/glfw_base.lua b/glfw_base.lua index 27dac64..a6cd2b0 100644 --- a/glfw_base.lua +++ b/glfw_base.lua @@ -5,6 +5,8 @@ local jit = require "jit" local Lib = {} +setmetatable(glc, {__index=function(self, k) error("Unknown GL constant: "..k) end}) + -- Load and export libraries local gl, glu, glfw if ffi.os == "Windows" then diff --git a/test.lua b/test.lua index c2b5070..3e03f97 100644 --- a/test.lua +++ b/test.lua @@ -6,6 +6,8 @@ local bit = require "bit" -- Localize the FFI libraries local gl, glc, glu, glfw, glext = lj_glfw.libraries() +assert(pcall(function() local _ = glc.this_doesnt_exist end) == false) + -- Define vertex arrays for the model we will draw local CubeVerticies = {} CubeVerticies.v = ffi.new("const float[8][3]", {