Skip to content

Instantly share code, notes, and snippets.

@borja-munoz
Created July 24, 2023 08:29
Show Gist options
  • Save borja-munoz/8b8b30d780c6d29b44c92217db85ee72 to your computer and use it in GitHub Desktop.
Save borja-munoz/8b8b30d780c6d29b44c92217db85ee72 to your computer and use it in GitHub Desktop.
// clear the back buffer to black for the new frame
device_ptr->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
device_ptr->BeginScene();
// select which vertex format we are using
device_ptr->SetFVF(CUSTOMFVF);
// select the vertex buffer to display
device_ptr->SetStreamSource(0, v_buffer, 0, sizeof(CUSTOMVERTEX));
// copy the vertex buffer to the back buffer
device_ptr->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
device_ptr->EndScene();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment