simplify gitignore
[vg.git] / src / vg / vg_lines.h
index 58e0e142d84f20e937d4cbc6e0ce8f6365404ec4..672a59e84d663b76fa407310d7ca0bc57e27c2e8 100644 (file)
@@ -48,7 +48,8 @@ static struct vg_shader _shader_lines =
 
 struct
 {
-   u32 draw;
+   u32 draw,
+       allow_input;
        
    struct vg_lines_vert
    {
@@ -85,7 +86,7 @@ VG_STATIC void vg_lines_init(void)
       u32 size = 50000 * sizeof( struct vg_lines_vert );
 
       vg_lines.vertex_buffer = 
-         vg_create_linear_allocator( vg_mem.rtmemory, size );
+         vg_create_linear_allocator(vg_mem.rtmemory, size, VG_MEMORY_REALTIME);
       
       glBufferData( GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW );
       glBindVertexArray( vg_lines.vao );
@@ -117,6 +118,7 @@ VG_STATIC void vg_lines_init(void)
    }
 
    vg_release_thread_sync();
+   vg_lines.allow_input = 1;
 }
 
 VG_STATIC void vg_lines_drawall( float* projection )
@@ -146,6 +148,9 @@ VG_STATIC void vg_lines_drawall( float* projection )
 
 VG_STATIC void vg_line2( line_co from, line_co to, u32 fc, u32 tc )
 {
+   if( !vg_lines.allow_input )
+      return;
+
    u32 size = 2 * sizeof(struct vg_lines_vert);
        struct vg_lines_vert *v = vg_linear_alloc( vg_lines.vertex_buffer, size );