Hey everyone, I've started working on a scripting engine for OpenGL and it's going along REALLY nicely. Here's the commands you can use in it so far:
DrawLine
EnableTextures
DisableTextures
Reset
SetColor
Rotate
EnableCulling
DrawMode
DisableCulling
Box
Each command can either take parameters or just be a normal command, for example, this code will draw an untextured line to the screen:
my goal with the engine is to make it so virtually anyone can do OpenGL, even if you don't have a compiler (or you stink at programming, lol)Code:/* Script-and-Go code by Jeff Verkoeyen, created 2003 */ VARIABLES; @int rot1; @float rot2; @char testing; @bool myBool; myBool=true; testing="hey"; rot1=1; rot2=1; BEGIN; rot1+1; rot2+1; DisableTextures; // Disables the textures Reset; Move(0,0,-100); SetColor(1.0f,1.0f,0.0f,0.5f); Rotate(rot1,1.0f,0.0f,0.0f); Move(10,20,0); Box(-10,10,0,10,10,0,10,-10,0,-10,-10,0); Reset; Move(0,0,-100); SetColor(0.0f,0.0f,1.0f,0.5f); Rotate(rot2,0.0f,0.0f,1.0f); Move(-10,0,0); Box(-10,10,0,10,10,0,10,-10,0,-10,-10,0); END;
the rules of the engine are these:
1) You must begin your main code with BEGIN, and you may have a section to declare variables, ABOVE the BEGIN-END section by declaring VARIABLES;
2) All commands must be ended with a semicolon (kinda like C/C++)
3) Comments include Long Comments and Line Comments, EX:
Long Comments begin with a /* and end with a */ and can go for multiple lines
Line Comments are just // and can be placed anywhere in a line and will comment everything from that point on to the end of the line
4) All commands that have parameters must have the parameters inside of parenthesis ( )
5) Any command without parameters must NOT have any parenthesis....that should make logical sense, lol (for example: Reset; does not take any parameters, so Reset(3); would return an error)
6) Any errors found in the code will generate an error inside the program, and then the program will quit (well, you have to handle the quitting and do it however you prefer)
7) To declare variables, you must do so in the VARIABLES; section. It would also be wise to initialize your variables at the top, also. You may do normal math operations to each of the variables whether in the VARIABLES; section or the BEGIN-END; section.
8) All programs MUST end with END
So, yah, I'm hoping to get this finished by Monday, because I'll be using it in my games from now on probably to quickly be able to test OpenGL code without having to recompile anything
lemme know what you think, and I'm looking for ideas of more commands I should put in the engine......
-edit-
updated the comment part
-edit 2-
updated everything that was needed to be updated (code, requirements, etc.)