Skip to main content
Associate
May 23, 2026
Solved

In a TouchGFX project, how do I use GPU2D to draw independently?

  • May 23, 2026
  • 3 replies
  • 84 views

I am currently using TouchGFX to develop a project. How can I independently control GPU2D to draw graphics on a dynamic bitmap without affecting the TouchGFX display? I have already obtained the NeoChromSDK, but the examples in the NeoChromSDK all use GPU2D independently as well.  I can draw with GPU2D if touchgfx not in use,But once I display them both, screen got glitched.

Best answer by AMB01

I kind of know what is wrong.

At the begaining of render,I enabled nema_enable_gradient(1); So the nema_clear can not work.

If I put nema_enable_gradient(1) after nema_clear, the nema_clear become normal.

3 replies

Associate
May 23, 2026

Use TouchGFX dynamic bitmaps. Render into them via TouchGFX APIs.

AMB01Author
Associate
May 23, 2026

This is what I have done:

VID_20260523_150154~3.gif

This terrain is rendered by lots of triangles. The terrain itself is fine,but the background is not.

I cleared the dynamic bitmap and draw like this :

 
nema_bind_dst_tex((uintptr_t)pbuf, 460, 460, NEMA_RGB565, -1);

nema_set_clip(0, 0, 460, 460);

nema_clear(nema_rgba(0, 0, 255, 0xff));

for(){

drawTriangles();

}

But the nema_clear seems not working.

Can I get some help from some @st_it guys?

AMB01AuthorAnswer
Associate
May 23, 2026

I kind of know what is wrong.

At the begaining of render,I enabled nema_enable_gradient(1); So the nema_clear can not work.

If I put nema_enable_gradient(1) after nema_clear, the nema_clear become normal.