idk I felt like making smth similar to opengl This is much more primitive then smth like opengl as there's less functions, but it has the essential draw color and Tex tri and quad functions, the color bind function, the add texture function, and more. To run a function, you have to use the function to add the function to the function query with either array params and/or single variables or just single variables with the correct function name. Unfortunately, all functions actually get called whenever the broadcast is called to call all the functions in the query. Anyways, here's the list of functions and their params: (reg1, reg2, ... reg_n are the params in the function caller) (anything with var_name[...] are arrays/lists u have to init manually before the function call) (quads are just 2 tris lol) (there's no draw tri or quads from index list I might add that but it'll require a different array layout) rnClearColor (reg1 h (0 - 360), reg2 s (0 - 100), reg3 v (0 - 100)) ! rnDrawLines (reg1 (int) r, reg2 (int) g, reg3 (int) b, vec1 lines [ floats x1, y1, floats x2, y2 ]) ! rnDrawLineStrip (reg1 (int) r, reg2 (int) g, reg3 (int) b, vec1 points [ floats x, y ]) ! rnDrawLineLoop (reg1 (int) r, reg2 (int) g, reg3 (int) b, vec1 points [ floats x, y ]) ! rnFillTriangleColor ( vec1 triangles_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 triangles_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 triangles_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ]) rnFillQuadColor ( vec1 quads_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 quads_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 quads_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ], vec3 quads_pointD [ A(x4, y4, z4, ...), B(x4, y4, z4, ...), ... ]) rnDrawTriangleColor ( // rasterizer version vec1 triangles_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 triangles_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 triangles_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ]) rnDrawQuadColor ( // rasterizer version vec1 quads_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 quads_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 quads_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ], vec3 quads_pointD [ A(x4, y4, z4, ...), B(x4, y4, z4, ...), ... ]) rnDrawTriangleTex ( vec1 triangles_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 triangles_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 triangles_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ]) rnDrawQuadTex ( vec1 quads_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 quads_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 quads_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ], vec3 quads_pointD [ A(x4, y4, z4, ...), B(x4, y4, z4, ...), ... ]) rnStampTriangleTex ( // uses stamping method, noticable distortion in some tests, but highly optmized vec1 triangles_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 triangles_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 triangles_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ]) rnStampQuadTex ( // uses stamping method, noticable distortion in some tests, but highly optmized vec1 quads_pointA [ A(x1, y1, z1, ...), B(x1, y1, z1, ...), ... ], vec2 quads_pointB [ A(x2, y2, z2, ...), B(x2, y2, z2, ...), ... ], vec3 quads_pointC [ A(x3, y3, z3, ...), B(x3, y3, z3, ...), ... ], vec3 quads_pointD [ A(x4, y4, z4, ...), B(x4, y4, z4, ...), ... ]) rnBindTexture2D ( )
Libraries used: Fast Tri Filler by @-Rex-Test- : https://scratch.mit.edu/projects/509029922/