Jump to content
  • Sign Up
  • 1
Rainb0wSkeppy

help with making cc plugin

Question

im trying to draw something but its not working
i checked that these functions are getting called
 

void myscreen_render(void* elem, float delta)
{
    struct f3_screen* s = elem;
    
    Gfx_SetVertexFormat(VERTEX_FORMAT_COLOURED);
    Gfx_BindDynamicVb(s -> vb);
    Gfx_DrawVb_IndexedTris(3);
}

void myscreen_build_mesh(void* elem)
{
    struct f3_screen* s = elem;
    struct VertexColoured vb[3];
    
    vb[0].x = 0.0f; vb[0].y = 0.0f; vb[0].z = 1.0f;
    vb[1].x = 1.0f; vb[1].y = 0.0f; vb[1].z = 1.0f;
    vb[2].x = 0.0f; vb[2].y = 1.0f; vb[2].z = 1.0f;

    vb[0].Col = PackedCol_Make(255, 0, 0, 255);
    vb[1].Col = PackedCol_Make(0, 255, 0, 255);
    vb[2].Col = PackedCol_Make(0, 0, 255, 255);
    
    Gfx_SetVertexFormat(VERTEX_FORMAT_COLOURED);
    Gfx_SetDynamicVbData(s -> vb, vb, 3);
}

void myscreen_on_context_lost(void* elem)
{
    struct f3_screen* s = elem;
    
    Gfx_DeleteDynamicVb(&s -> vb);
}

void myscreen_on_context_recreated(void* elem)
{
    struct f3_screen* s = elem;
    
    s -> vb = Gfx_CreateDynamicVb(VERTEX_FORMAT_COLOURED, 3);
    s -> maxVertices = 3;
}

 

Share this post


Link to post

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...