mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-27 20:57:01 +08:00
docs(3dtexture.rst): get this doc into TOC and proofread (#8143)
Co-authored-by: André Costa <andre_miguel_costa@hotmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
Overview
|
Overview
|
||||||
********
|
********
|
||||||
|
|
||||||
3D texture widgets are used to embed an external 3D graphics library's "texutre" primitive
|
3D texture widgets are used to embed an external 3D graphics library's "texture" primitive
|
||||||
into an LVGL UI.
|
into an LVGL UI.
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Usage
|
|||||||
Requires a draw unit to be enabled which can draw the
|
Requires a draw unit to be enabled which can draw the
|
||||||
:cpp:enumerator:`LV_DRAW_TASK_TYPE_3D` draw task type.
|
:cpp:enumerator:`LV_DRAW_TASK_TYPE_3D` draw task type.
|
||||||
|
|
||||||
OpenGL is the first supported 3D graphics backend. The following must be enabled.
|
OpenGL is the first supported 3D graphics back-end. The following must be enabled.
|
||||||
|
|
||||||
- :c:macro:`LV_USE_3DTEXTURE`
|
- :c:macro:`LV_USE_3DTEXTURE`
|
||||||
- :c:macro:`LV_USE_OPENGLES`
|
- :c:macro:`LV_USE_OPENGLES`
|
||||||
@@ -37,20 +37,20 @@ OpenGL is the first supported 3D graphics backend. The following must be enabled
|
|||||||
See :ref:`LVGL's OpenGLES driver docs <opengl_es_driver>` to create a window and a
|
See :ref:`LVGL's OpenGLES driver docs <opengl_es_driver>` to create a window and a
|
||||||
display texture.
|
display texture.
|
||||||
|
|
||||||
The `lv_example_3dtexture <https://github.com/lvgl/lv_example_3dtexture>` repo is a
|
The `lv_example_3dtexture <https://github.com/lvgl/lv_example_3dtexture>` repository is a
|
||||||
demonstration of how to use the ``3dtexture`` widget to load glTF models with OpenGL
|
demonstration of how to use the ``3dtexture`` widget to load glTF models with OpenGL
|
||||||
and display them in LVGL.
|
and display them in LVGL.
|
||||||
|
|
||||||
.. code-block:: c
|
.. code-block:: c
|
||||||
|
|
||||||
lv_obj_t * tex = lv_3dtexture_create(parent);
|
lv_obj_t * tex = lv_3dtexture_create(parent);
|
||||||
/*Render something to the texture. You can replace it with your code.*/
|
/* Render something to the texture. You can replace it with your code. */
|
||||||
lv_3dtexture_id_t gltf_texture = render_gltf_model_to_opengl_texture(path, w, h, color);
|
lv_3dtexture_id_t gltf_texture = render_gltf_model_to_opengl_texture(path, w, h, color);
|
||||||
lv_3dtexture_set_src(tex, gltf_texture);
|
lv_3dtexture_set_src(tex, gltf_texture);
|
||||||
lv_obj_set_size(tex, w, h);
|
lv_obj_set_size(tex, w, h);
|
||||||
lv_obj_set_style_opa(tex, opa, 0);
|
lv_obj_set_style_opa(tex, opa, 0);
|
||||||
|
|
||||||
The real type of :cpp:type:`lv_3dtexture_id_t` depends on the active 3D graphics backend.
|
The real type of :cpp:type:`lv_3dtexture_id_t` depends on the active 3D graphics back-end.
|
||||||
With OpenGL, the type is ``unsigned int``.
|
With OpenGL, the type is ``unsigned int``.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ All Widgets
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
|
3dtexture
|
||||||
animimg
|
animimg
|
||||||
arc
|
arc
|
||||||
bar
|
bar
|
||||||
|
|||||||
Reference in New Issue
Block a user