Hello, IMO you don't need to display a *HUGE* skybox just to show the sky. I only draw a 10 unit size cube with proper texture on it. The cube is drawn first, the faces are facing inside, and I disable depth testing and depth writes when drawing it. Then I turn depth testing and depth writes back on and draw other objects in the scene. It creates illusion of *LARGE* box encompassing all objects in the scene.
Hi, I've finished a small scripting language resembling a C-language. I named it clsl (stands for C-Like Scripting Language). I miss one critical implementation though .... and that's the syntax checker!!
So I'm asking you guys, since I really know nowhere else to look. How do compilers perform syntax checking? when do they do it? Do they: -check syntax of all source files, then only proceeds to compile if there's no coding typo/typing error or do they: -compile the source, catch error along the way, and then decide whether to continue/stop the compilation. Right now, this is what I'm using. The compiler compiles all source, and abort the process once it encounters any error (and also write the error to log file). Thing is, I think there are way too much error cases to catch, and thus this approach is kinda ugly and of course there are MANY times where my script compiler just crash and doesn't report anything (a non-reproducible bug/flaw). Do you have a suggestion of how to write a good syntax checker? thanks btw
Whoa, thanks for your suggestions!! it supports recursion now, basically for each script function I store:
-information about its local data(local variables and function parameters), how many local vars, how many bytes needed for those local vars.
-its return type
then when the script calls a function, it will:
-allocate bytes needed for the function's local data + request storage for return value
-point the function to the allocated bytes
-'push' to the call stack (make it the current function)
-execute its instructions
upon returning, it will:
-store any return value it has to store
-release all data it has
-restore call stack or 'pop'
and it worked nicely, I've tested it by making a factorial function inside the script.....now I only need to 'FIX' the stack size (I want to allocate some bytes at the beginning that acts as a stack 'pool', but that's not hard to do)
BTW I'm trying to get the same effect with my framework here, thing is....I only load map on demand (when the player collides with a trigger, and that trigger call change_map() ). How am I going to do that? I can pre-load all maps but that might consume enormous amount of memory. So if you got any ideas, please share here....thanks!!
I just realized that some games provide the user with the capability to set the "brightness" or gamma correction (CMIIW). I want to implement it but I wonder how would I go for it in OpenGL? Do you know if such a way exist? Thanks before