xiaoxiang781216 commented on code in PR #3808:
URL: https://github.com/apache/nuttx-apps/pull/3808#discussion_r4214333650


##########
graphics/uGLy/CMakeLists.txt:
##########
@@ -0,0 +1,102 @@
+# 
##############################################################################
+# apps/graphics/uGLy/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+# license agreements.  See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership.  The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may 
not
+# use this file except in compliance with the License.  You may obtain a copy 
of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+# 
##############################################################################
+
+if(CONFIG_GRAPHICS_UGLY)
+
+  # 
############################################################################
+  # Config and Fetch uGLy
+  # 
############################################################################
+
+  set(UGLY_DIR ${CMAKE_CURRENT_LIST_DIR}/uGLy)
+
+  if(NOT CONFIG_GRAPH_UGLY_URL)

Review Comment:
   remove the check



##########
graphics/uGLy/Makefile:
##########
@@ -0,0 +1,80 @@
+############################################################################
+# apps/graphics/uGLy/Makefile
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(APPDIR)/Make.defs
+
+# uGLy graphic library
+
+# Set up build configuration and environment
+
+WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
+
+CONFIG_GRAPH_UGLY_URL ?= 
"https://github.com/TheFakeMontyOnTheRun/uGLy/archive/refs/tags";
+
+UGLY_PACKAGE := test-for-0.1
+UGLY_TARBALL := $(UGLY_PACKAGE).zip
+
+UGLY_UNPACKNAME = uGLy
+UNPACK ?= unzip -o $(if $(V),,-q)
+CURL ?= curl -L -O $(if $(V),,-Ss)
+
+UGLY_UNPACKDIR =  $(WD)/$(UGLY_UNPACKNAME)
+
+# Patches applied on top of the uGLy release, in name order
+
+UGLY_PATCHES := $(sort $(wildcard patches/*.patch))
+
+$(UGLY_TARBALL):
+       $(ECHO_BEGIN)"Downloading: $(UGLY_TARBALL)"
+       $(Q) $(CURL) $(CONFIG_GRAPH_UGLY_URL)/$(UGLY_TARBALL)
+       $(ECHO_END)
+
+$(UGLY_UNPACKNAME): $(UGLY_TARBALL) $(UGLY_PATCHES)
+       $(ECHO_BEGIN)"Unpacking: $(UGLY_TARBALL) -> $(UGLY_UNPACKNAME)"
+       $(Q) $(UNPACK) $(UGLY_TARBALL)
+       $(call DELDIR, $(UGLY_UNPACKNAME))
+       $(Q) mv uGLy-$(UGLY_PACKAGE) $(UGLY_UNPACKNAME)
+       $(Q) $(foreach p,$(UGLY_PATCHES),patch -s -p1 -d $(UGLY_UNPACKNAME) < 
$(p) &&) true
+       $(Q) touch $(UGLY_UNPACKNAME)
+       $(Q) cp Make_uGLy.defs uGLy/Make.defs
+       $(ECHO_END)
+
+# Download and unpack tarball if no git repo found
+ifeq ($(wildcard $(UGLY_UNPACKNAME)/.git),)
+context:: $(UGLY_UNPACKNAME)
+endif
+
+# only includes this file next time when it was copied in the above step
+-include uGLy/Make.defs
+
+CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/graphics/uGLy/uGLy/third_party/fpsqrt
+CFLAGS += -DBPP24 -DDISABLE_STENCIL_BUFFER
+CFLAGS += -DXRES_FRAMEBUFFER=$(CONFIG_GRAPHICS_UGLY_XRES)
+CFLAGS += -DYRES_FRAMEBUFFER=$(CONFIG_GRAPHICS_UGLY_YRES)
+
+include $(APPDIR)/Application.mk
+
+ifeq ($(wildcard $(UGLY_UNPACKNAME)/.git),)
+distclean::

Review Comment:
   move after line 64



##########
graphics/uGLy/Makefile:
##########
@@ -0,0 +1,80 @@
+############################################################################
+# apps/graphics/uGLy/Makefile
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(APPDIR)/Make.defs
+
+# uGLy graphic library
+
+# Set up build configuration and environment
+
+WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'}
+
+CONFIG_GRAPH_UGLY_URL ?= 
"https://github.com/TheFakeMontyOnTheRun/uGLy/archive/refs/tags";
+
+UGLY_PACKAGE := test-for-0.1
+UGLY_TARBALL := $(UGLY_PACKAGE).zip
+
+UGLY_UNPACKNAME = uGLy
+UNPACK ?= unzip -o $(if $(V),,-q)
+CURL ?= curl -L -O $(if $(V),,-Ss)
+
+UGLY_UNPACKDIR =  $(WD)/$(UGLY_UNPACKNAME)
+
+# Patches applied on top of the uGLy release, in name order
+
+UGLY_PATCHES := $(sort $(wildcard patches/*.patch))
+
+$(UGLY_TARBALL):
+       $(ECHO_BEGIN)"Downloading: $(UGLY_TARBALL)"
+       $(Q) $(CURL) $(CONFIG_GRAPH_UGLY_URL)/$(UGLY_TARBALL)
+       $(ECHO_END)
+
+$(UGLY_UNPACKNAME): $(UGLY_TARBALL) $(UGLY_PATCHES)
+       $(ECHO_BEGIN)"Unpacking: $(UGLY_TARBALL) -> $(UGLY_UNPACKNAME)"
+       $(Q) $(UNPACK) $(UGLY_TARBALL)
+       $(call DELDIR, $(UGLY_UNPACKNAME))
+       $(Q) mv uGLy-$(UGLY_PACKAGE) $(UGLY_UNPACKNAME)
+       $(Q) $(foreach p,$(UGLY_PATCHES),patch -s -p1 -d $(UGLY_UNPACKNAME) < 
$(p) &&) true
+       $(Q) touch $(UGLY_UNPACKNAME)
+       $(Q) cp Make_uGLy.defs uGLy/Make.defs
+       $(ECHO_END)
+
+# Download and unpack tarball if no git repo found
+ifeq ($(wildcard $(UGLY_UNPACKNAME)/.git),)
+context:: $(UGLY_UNPACKNAME)
+endif
+
+# only includes this file next time when it was copied in the above step
+-include uGLy/Make.defs
+
+CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/graphics/uGLy/uGLy/third_party/fpsqrt
+CFLAGS += -DBPP24 -DDISABLE_STENCIL_BUFFER
+CFLAGS += -DXRES_FRAMEBUFFER=$(CONFIG_GRAPHICS_UGLY_XRES)
+CFLAGS += -DYRES_FRAMEBUFFER=$(CONFIG_GRAPHICS_UGLY_YRES)
+
+include $(APPDIR)/Application.mk

Review Comment:
   move to the end of file



##########
graphics/uGLy/patches/0002-src-nuttx.c-add-a-NuttX-framebuffer-backend.patch:
##########
@@ -0,0 +1,426 @@
+From caba3d9b60e3d3a445b8e7968fc1cb212b297f14 Mon Sep 17 00:00:00 2001
+From: Alan Carvalho de Assis <[email protected]>
+Date: Wed, 16 Sep 2026 15:16:32 -0300
+Subject: [PATCH 2/2] src/nuttx.c: add a NuttX framebuffer backend
+
+The library expects each platform backend to own the render buffers
+("framebuffer", "zBuffer" and "stencilBuffer", which internal.h declares
+as pointers) and to provide initWindow()/swapBuffers(). NuttX had no

Review Comment:
   why not add the code in to apps.git? do you plan upstream the change?



##########
graphics/uGLy/Make_uGLy.defs:
##########
@@ -20,14 +20,14 @@
 #
 ############################################################################
 
-include $(APPDIR)/Make.defs
+DEPPATH += --dep-path uGLy
+VPATH += :uGLy
 
-# ZBus message bus library (Zephyr zbus port)
+CSRCS += es10cl.c es11.c matricesFP.c raster.c
+CSRCS += fpsqrt.c
 
-CSRCS = zbus.c zbus_iterable_sections.c
+DEPPATH += --dep-path uGLy/src
+DEPPATH += --dep-path uGLy/third_party/fpsqrt
 
-ifneq ($(CONFIG_ZBUS_RUNTIME_OBSERVERS),)
-CSRCS += zbus_runtime_observers.c
-endif
-
-include $(APPDIR)/Application.mk
+VPATH += :uGLy/src
+VPATH += :uGLy/third_party/fpsqrt

Review Comment:
   but why need?



##########
graphics/uGLy/patches/0001-internal.h-allow-the-framebuffer-size-to-be-set-by-t.patch:
##########
@@ -0,0 +1,41 @@
+From 944fe2eb78fe931cffca8cb6a942bcaa541ad8fc Mon Sep 17 00:00:00 2001
+From: Alan Carvalho de Assis <[email protected]>
+Date: Wed, 16 Sep 2026 15:15:47 -0300
+Subject: [PATCH 1/2] internal.h: allow the framebuffer size to be set by the
+ build system
+
+XRES_FRAMEBUFFER and YRES_FRAMEBUFFER were hardcoded per platform, so
+a port whose display is not 256x267 had to edit internal.h. Only use
+the built-in defaults when the build system does not provide both
+values (e.g. -DXRES_FRAMEBUFFER=320 -DYRES_FRAMEBUFFER=240).
+
+Signed-off-by: Alan C. Assis <[email protected]>
+---
+ include/internal.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/include/internal.h b/include/internal.h
+index 175215f..7ffa2a0 100644
+--- a/include/internal.h
++++ b/include/internal.h
+@@ -13,6 +13,12 @@
+ 
+ typedef void ( *KeyCallback )(int charkey);
+ 
++/* The framebuffer size can be provided by the build system, e.g.:
++ * -DXRES_FRAMEBUFFER=320 -DYRES_FRAMEBUFFER=240
++ */
++#if !defined(XRES_FRAMEBUFFER) || !defined(YRES_FRAMEBUFFER)
++#undef XRES_FRAMEBUFFER
++#undef YRES_FRAMEBUFFER
+ #ifdef DOS

Review Comment:
   My question is why we need this change which just active in DOS?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to