mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tools: make v test-cleancode
test everything by default (#10050)
This commit is contained in:
@@ -6,7 +6,7 @@ pub const (
|
||||
version = gfx.version + 1
|
||||
)
|
||||
|
||||
/* setup/shutdown/misc */
|
||||
// setup/shutdown/misc
|
||||
[inline]
|
||||
pub fn setup(desc &C.sgl_desc_t) {
|
||||
C.sgl_setup(desc)
|
||||
@@ -37,7 +37,7 @@ pub fn deg(rad f32) f32 {
|
||||
return C.sgl_deg(rad)
|
||||
}
|
||||
|
||||
/* create and destroy pipeline objects */
|
||||
// create and destroy pipeline objects
|
||||
[inline]
|
||||
pub fn make_pipeline(desc &C.sg_pipeline_desc) C.sgl_pipeline {
|
||||
return C.sgl_make_pipeline(desc)
|
||||
@@ -48,7 +48,7 @@ pub fn destroy_pipeline(pip C.sgl_pipeline) {
|
||||
C.sgl_destroy_pipeline(pip)
|
||||
}
|
||||
|
||||
/* render state functions */
|
||||
// render state functions
|
||||
[inline]
|
||||
pub fn viewport(x int, y int, w int, h int, origin_top_left bool) {
|
||||
C.sgl_viewport(x, y, w, h, origin_top_left)
|
||||
@@ -74,7 +74,7 @@ pub fn texture(img C.sg_image) {
|
||||
C.sgl_texture(img)
|
||||
}
|
||||
|
||||
/* pipeline stack functions */
|
||||
// pipeline stack functions
|
||||
[inline]
|
||||
pub fn default_pipeline() {
|
||||
C.sgl_default_pipeline()
|
||||
@@ -95,7 +95,7 @@ pub fn pop_pipeline() {
|
||||
C.sgl_pop_pipeline()
|
||||
}
|
||||
|
||||
/* matrix stack functions */
|
||||
// matrix stack functions
|
||||
[inline]
|
||||
pub fn matrix_mode_modelview() {
|
||||
C.sgl_matrix_mode_modelview()
|
||||
@@ -181,7 +181,7 @@ pub fn pop_matrix() {
|
||||
C.sgl_pop_matrix()
|
||||
}
|
||||
|
||||
/* these functions only set the internal 'current texcoord / color' (valid inside or outside begin/end) */
|
||||
// these functions only set the internal 'current texcoord / color' (valid inside or outside begin/end)
|
||||
[inline]
|
||||
pub fn t2f(u f32, v f32) {
|
||||
C.sgl_t2f(u, v)
|
||||
@@ -212,7 +212,7 @@ pub fn c1i(rgba u32) {
|
||||
C.sgl_c1i(rgba)
|
||||
}
|
||||
|
||||
/* define primitives, each begin/end is one draw command */
|
||||
// define primitives, each begin/end is one draw command
|
||||
[inline]
|
||||
pub fn begin_points() {
|
||||
C.sgl_begin_points()
|
||||
@@ -368,9 +368,8 @@ pub fn end() {
|
||||
C.sgl_end()
|
||||
}
|
||||
|
||||
/* render everything */
|
||||
// render everything
|
||||
[inline]
|
||||
pub fn draw() {
|
||||
C.sgl_draw()
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
module sgl
|
||||
|
||||
/* setup/shutdown/misc */
|
||||
// setup/shutdown/misc
|
||||
fn C.sgl_setup(desc &C.sgl_desc_t)
|
||||
fn C.sgl_shutdown()
|
||||
fn C.sgl_error() C.sgl_error_t
|
||||
@@ -8,11 +8,11 @@ fn C.sgl_defaults()
|
||||
fn C.sgl_rad(deg f32) f32
|
||||
fn C.sgl_deg(rad f32) f32
|
||||
|
||||
/* create and destroy pipeline objects */
|
||||
// create and destroy pipeline objects
|
||||
fn C.sgl_make_pipeline(desc &C.sg_pipeline_desc) C.sgl_pipeline
|
||||
fn C.sgl_destroy_pipeline(pip C.sgl_pipeline)
|
||||
|
||||
/* render state functions */
|
||||
// render state functions
|
||||
fn C.sgl_viewport(x int, y int, w int, h int, origin_top_left bool)
|
||||
fn C.sgl_viewportf(x f32, y f32, w f32, h f32, origin_top_left bool)
|
||||
fn C.sgl_scissor_rect(x int, y int, w int, h int, origin_top_left bool)
|
||||
@@ -21,13 +21,13 @@ fn C.sgl_enable_texture()
|
||||
fn C.sgl_disable_texture()
|
||||
fn C.sgl_texture(img C.sg_image)
|
||||
|
||||
/* pipeline stack functions */
|
||||
// pipeline stack functions
|
||||
fn C.sgl_default_pipeline()
|
||||
fn C.sgl_load_pipeline(pip C.sgl_pipeline)
|
||||
fn C.sgl_push_pipeline()
|
||||
fn C.sgl_pop_pipeline()
|
||||
|
||||
/* matrix stack functions */
|
||||
// matrix stack functions
|
||||
fn C.sgl_matrix_mode_modelview()
|
||||
fn C.sgl_matrix_mode_projection()
|
||||
fn C.sgl_matrix_mode_texture()
|
||||
@@ -46,7 +46,7 @@ fn C.sgl_lookat(eye_x f32, eye_y f32, eye_z f32, center_x f32, center_y f32, cen
|
||||
fn C.sgl_push_matrix()
|
||||
fn C.sgl_pop_matrix()
|
||||
|
||||
/* these functions only set the internal 'current texcoord / color' (valid inside or outside begin/end) */
|
||||
// these functions only set the internal 'current texcoord / color' (valid inside or outside begin/end)
|
||||
fn C.sgl_t2f(u f32, v f32)
|
||||
fn C.sgl_c3f(r f32, g f32, b f32)
|
||||
fn C.sgl_c4f(r f32, g f32, b f32, a f32)
|
||||
@@ -54,7 +54,7 @@ fn C.sgl_c3b(r byte, g byte, b byte)
|
||||
fn C.sgl_c4b(r byte, g byte, b byte, a byte)
|
||||
fn C.sgl_c1i(rgba u32)
|
||||
|
||||
/* define primitives, each begin/end is one draw command */
|
||||
// define primitives, each begin/end is one draw command
|
||||
fn C.sgl_begin_points()
|
||||
fn C.sgl_begin_lines()
|
||||
fn C.sgl_begin_line_strip()
|
||||
@@ -87,5 +87,5 @@ fn C.sgl_v3f_t2f_c4b(x f32, y f32, z f32, u f32, v f32, r byte, g byte, b byte,
|
||||
fn C.sgl_v3f_t2f_c1i(x f32, y f32, z f32, u f32, v f32, rgba u32)
|
||||
fn C.sgl_end()
|
||||
|
||||
/* render everything */
|
||||
// render everything
|
||||
fn C.sgl_draw()
|
||||
|
@@ -2,7 +2,7 @@ module sgl
|
||||
|
||||
// should be in a proper module
|
||||
pub enum SglError {
|
||||
no_error
|
||||
no_error
|
||||
vertices_full
|
||||
commands_full
|
||||
stack_overflow
|
||||
@@ -14,11 +14,11 @@ pub struct C.sgl_pipeline {
|
||||
}
|
||||
|
||||
pub struct C.sgl_desc_t {
|
||||
max_vertices int /* size for vertex buffer */
|
||||
max_commands int /* size of uniform- and command-buffers */
|
||||
pipeline_pool_size int /* size of the internal pipeline pool, default is 64 */
|
||||
color_format C.sg_pixel_format
|
||||
depth_format C.sg_pixel_format
|
||||
sample_count int
|
||||
face_winding C.sg_face_winding /* default front face winding is CCW */
|
||||
max_vertices int // size for vertex buffer
|
||||
max_commands int // size of uniform- and command-buffers
|
||||
pipeline_pool_size int // size of the internal pipeline pool, default is 64
|
||||
color_format C.sg_pixel_format
|
||||
depth_format C.sg_pixel_format
|
||||
sample_count int
|
||||
face_winding C.sg_face_winding // default front face winding is CCW
|
||||
}
|
||||
|
Reference in New Issue
Block a user