cancel
Showing results for 
Search instead for 
Did you mean: 

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

AMB01
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
AMB01
Associate II

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.

View solution in original post

4 REPLIES 4
loveforcircuits
Associate III

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

AMB01
Associate II

This is what I have achieved:

VID_20260523_150154~3.gif

This is a 3D terrain display. Using nemagfx I can draw 1000 triangles per frame.

The triangles are rendered fine,but the backGround is not.

This is how I am doing it:

In tick call of screenView.cpp:

drawGL(dynamicBitMapAdress);

In drawGL function:

nema_cmdlist_t *tempList=nema_cl_get_bound();
nema_cl_wait(tempList);
nema_bind_dst_tex((uintptr_t)dynamicBitMapAdress, 460, 460, NEMA_RGB565, -1);
nema_set_clip(0, 0, 460, 460);
nema_clear(nema_rgba(255, 255, 255, 0xff));
for(){
    caculateTriangles();
    nema_interpolate_tri_colors(x0, y0, x1, y1, x2, y2,
                                &col0, &col1, &col2);
    nema_raster_triangle_f(x0, y0, x1, y1, x2, y2);
}
nema_cl_wait(tempList);

 I called nema_clear,But it have no effect.

Can I get some help from @st gusys?

AMB01
Associate II

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 guys?

AMB01
Associate II

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.