Recent

Author Topic: ZenGL +android + MacOS Cocoa  (Read 23540 times)

fcu

  • Full Member
  • ***
  • Posts: 118
Re: ZenGL +android + MacOS Cocoa
« Reply #30 on: December 30, 2024, 04:09:39 pm »
thank you very much

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #31 on: January 07, 2025, 11:42:40 am »
Обновил версию до ZenGL 4.15.

  Больших изменений нет, но какие-то критичные изменения присутствуют:
Quote
- исправлен баг для Linux, когда при вызове "zgl_SetParam" параметры рабочей области не менялись вместе с общей областью. Это критично для функционала мыши: например в игре "Змейка", если включить мышь, не работал нижний пункт меню, мышь якобы выходила за пределы окна.
- исправлены ошибки для Mac OS. В том числе и изменение размеров окна и переключения окна в полноэкранный режим и обратно (теперь 4-я демка правильно работает, кроме одного пункта).
- когда при создании окна задан хоть один параметр больше размера окна, приложение переходит в полноэкранный режим.
- исправлены ошибки связанные с Android. В том числе исправлена ошибка по работе с тачскрином, теперь корректированное окно возвращает значения касаний только в пределах рабочего окна (для полного окна есть глобальные координаты).
- исправлена "древняя" ошибка джойстиков (Linux) при отладке приложений (и сразу во все демки добавлены все флаги отладки) - благодарность Skvoznjak за напоминание и напоминание как обойти проблему.
- исправлена работа с мышкой в LCL-приложениях.
- исправлено возвращение дирректорий для LCL-приложений.

В общем где-то ошибки древние и руки до них не доходили, а где-то закравшиеся ошибки, из-за того, что пилю до сих пор внутрянку ZenGL. Пора бы уже достаточно стабильной ей стать, да всё равно мелочи вылазят.

Вот что это за баг выполз? Для Android-приложений. Если где-то в начале объявить одним из первых модулей Sysutils, то приложение просто "не запустится", и ошибок не выдаст. Просто будет висеть и пытаться проинициализироваться.
Отметьте для себя, что для Android не надо Sysutils ставить одним из первых модулей в главном модуле программы.

В общем, думаю достаточно стабильная версия. Я даже до Mac-а добрался, чтоб исправить ошибки (хотя, там исправлять то нечего было для изменения разрешения, сам давным давно пропустил момент обновления окна).

Всех с праздниками!  8-)


-------------------------------------------------
Google translate:
Updated to ZenGL 4.15.

No major changes, but some critical changes are present:
Quote
- fixed a bug for Linux, when calling "zgl_SetParam" the parameters of the workspace did not change along with the general area. This is critical for the functionality of the mouse: for example, in the game "Snake", if you turn on the mouse, the bottom menu item did not work, the mouse allegedly went beyond the window.
- fixed bugs for Mac OS. Including changing the window size and switching the window to full-screen mode and back (now the 4th demo works correctly, except for one item).
- when at least one parameter larger than the window size is specified when creating a window, the application switches to full-screen mode.
- fixed bugs related to Android. Including the bug with working with the touchscreen fixed, now the adjusted window returns touch values ​​only within the working window (there are global coordinates for the full window).
- the "ancient" bug with joysticks (Linux) when debugging applications fixed (and all debug flags were added to all demos at once) - thanks to Skvoznjak for the reminder and reminder on how to get around the problem.
- working with the mouse in LCL applications fixed.
- returning directories for LCL applications fixed.

In general, some of the errors are ancient and I never got around to them, and some are errors that have crept in because I'm still sawing the internals of ZenGL. It's time for it to become stable enough, but little things still pop up.

What kind of bug is this? For Android applications. If somewhere at the beginning you declare Sysutils as one of the first modules, then the application simply "will not start" and will not give errors. It will simply hang and try to initialize.
Note for yourself that for Android you do not need to set Sysutils as one of the first modules in the main module of the program.

In general, I think it is a fairly stable version. I even got to Mac to fix the errors (although there was nothing to fix there to change the resolution, I myself missed the moment of updating the window a long time ago).

Happy holidays to all! 8-)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #32 on: February 14, 2025, 03:52:25 am »
Привет всем!  ;)

Выпущена новая версия --> ZenGL 4.16. <--

Из важных изменений ZenGL это:
Quote
- созданы динамические библиотеки (в архиве содержаться, но можете собрать и сами).
- перебраны модули "zgl_sprite_2d.pas", "zgl_grid_2d.pas", "zgl_render_target.pas" и "zgl_textures.pas". Из-за чего новая версия обратно не совместима с прошлыми версиями.  :(

Теперь вы можете собрать четыре разных динамических библиотеки ZenGL! Обратите внимание на это.
- одна библиотека для стандартного функционала ZenGL.
- одна библиотека для использования ZenGL в LCL/VCL приложениях.
- одна библиотека для использования нужной вам версии OpenGL (можно использовать полную функциональность OpenGL, но в большинстве случаев не совместима с графическим функционалом ZenGL).
- одна библиотека для использования нужной вам версии OpenGL в LCL/VCL приложениях.

Из обновлений ZenGL:
Quote
- изменены константы для таймеров, теперь: TIMER_STOP, TIMER_START, TIMER_SLEEP_TO_START и TIMER_SLEEP_TO_STOP.
- в модуль "zgl_textures.pas" добавлены функции: "tex_GetWidth", "tex_GetHeight", "tex_GetTextireID" и "tex_GetZglPTexture".
- в модуль "zgl_render_target.pas" добавлена функция "rtarget_GetSurface".
- исправлена ошибка в процедуре "pr2d_Rect", при определённых данных прямоугольник мог не прорисоваться.
- добавлена процедура "mouse_LockInScreen", которая производит захват мыши в области экрана. Пока только для Windows и для Linux.
- исправлена давняя проблема в процедуре "tex_CalcAlpha". Пока не известно, влияла ли на что-то эта ошибка, но есть подозрения что это вызывало переполнение памяти в демках "LightEngine2D" для Delphi.
- добавлена 17-я демка, показывающая работу с полным OpenGL в LCL/VCL приложениях.
- в модуль "zgl_pasOpenGL" добавлены функции: "gl_GetVerMajor" и "gl_GetVerMinor". Нужны только для связи ZenGL с данным модулем.
- в модуль "zgl_font.pas" добавлена функция "zgl_GetFont".
- созданы демки для новых версий Delphi. С динамическими библиотеками теперь можно запускать 64-х битные приложения на Delphi.
- в модуль "zgl_application" добавлены процедуры "app_MainLoopHandle" и "app_MouseProc" для обратной связи с ZenGL. Нужно только для LCL/VCL приложений.
- другие множественные изменения.

Из обновлений Green Engine:
Quote
- добавлена функция "ge_GetEdit" - возвращает указатель на структуру поля ввода.
- функция "ge_GetEditToText" переименована в "ge_GetTextEdit".
- функция "ge_SetTextToEdit" переименована в "ge_SetTextEdit".
- некоторые другие корректировки кода.

Изменений очень много, если хотите с ними ознакомиться, читайте "Update_ZenGL.txt".

Множество примеров в демках и документированы! Так же лежат сопровождающие файлы "ReadMe.txt".

Всем успехов!  :D



-----------------------------------------------------------------------------
Google translate:
Hello everyone! ;)

A new version of --> ZenGL 4.16 has been released. <--

Among the important changes in ZenGL are:
Quote
- dynamic libraries have been created (they are included in the archive, but you can compile them yourself).
- modules "zgl_sprite_2d.pas", "zgl_grid_2d.pas", "zgl_render_target.pas" and "zgl_textures.pas" have been rewritten. Because of this, the new version is not backward compatible with previous versions. :(

You can now build four different ZenGL dynamic libraries! Pay attention to this.
- one library for standard ZenGL functionality.
- one library for using ZenGL in LCL/VCL applications.
- one library for using the OpenGL version you need (you can use the full functionality of OpenGL, but in most cases it is not compatible with the graphics functionality of ZenGL).
- one library for using the version of OpenGL you need in LCL/VCL applications.

From the updates of ZenGL:
Quote
- changed constants for timers, now: TIMER_STOP, TIMER_START, TIMER_SLEEP_TO_START and TIMER_SLEEP_TO_STOP.
- the following functions have been added to the "zgl_textures.pas" module: "tex_GetWidth", "tex_GetHeight", "tex_GetTextireID" and "tex_GetZglPTexture".
- the "rtarget_GetSurface" function has been added to the "zgl_render_target.pas" module.
- a bug in the "pr2d_Rect" procedure has been fixed; with certain data, the rectangle might not be drawn.
- the "mouse_LockInScreen" procedure has been added, which captures the mouse in the screen area. So far only for Windows and Linux.
- a long-standing problem in the "tex_CalcAlpha" procedure has been fixed. It is not yet known whether this error affected anything, but there are suspicions that it caused a memory overflow in the "LightEngine2D" demos for Delphi.
- the 17th demo was added, showing work with full OpenGL in LCL/VCL applications.
- the following functions were added to the "zgl_pasOpenGL" module: "gl_GetVerMajor" and "gl_GetVerMinor". They are only needed to connect ZenGL with this module.
- the "zgl_font.pas" module added the "zgl_GetFont" function.
- demos for new versions of Delphi were created. With dynamic libraries, you can now run 64-bit Delphi applications.
- "app_MainLoopHandle" and "app_MouseProc" procedures for feedback with ZenGL have been added to the "zgl_application" module. This is only needed for LCL/VCL applications.
- other numerous changes.

From the Green Engine updates:
Quote
- added the "ge_GetEdit" function - returns a pointer to the input field structure.
- renamed the "ge_GetEditToText" function to "ge_GetTextEdit".
- renamed the "ge_SetTextToEdit" function to "ge_SetTextEdit".
- some other code adjustments.

There are a lot of changes, if you want to read them, read "Update_ZenGL.txt".

Lots of demos and documented examples! Also there are accompanying files "ReadMe.txt".

Good luck to everyone! :D

« Last Edit: February 14, 2025, 03:56:24 am by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

fcu

  • Full Member
  • ***
  • Posts: 118
Re: ZenGL +android + MacOS Cocoa
« Reply #33 on: February 22, 2025, 10:12:18 am »
nice, you've done an excellent work
about the particle editor application that was in the zengl ancient website (https://www.zengl.org/download.html)   
do you have a copy of it ?

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #34 on: March 02, 2025, 01:33:50 am »
fcu, благодарю!
Извиняюсь что не сразу отвечаю. Я перебрал версию программы "Particle Engine", положите её в папку "tools" и соберите проект.
Делаёте сборку только со статической линковкой. С динамической могут быть проблемы.
Я проверял в Linux её, потому не могу 100% сказать что на других платформах она соберётся, но надеюсь должна.
На других платформах проверю позже.

------------------------------------------
Google translate:
fcu, thank you!
Sorry for not answering right away. I have reworked the version of the program "Particle Engine". Put it in the "tools" folder and build the project.
Build only with static linking. There may be problems with dynamic.
I checked it on Linux, so I can't say 100% that it will build on other platforms, but I hope it will work.
I'll check on other platforms later.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #35 on: March 05, 2025, 04:21:00 pm »
Всем привет!
Очередное обновление для --> ZenGL 0.4.17. <--

Quote
- исправлены проблемы в работе многих менеджеров. Ранее могла проявляться ошибка когда ресурс якобы не загрузился/не создался.
- исправлена ошибка в функции text_Draw, это было при использовании выравнивания и проявлялось когда переносится только одно слово.
- теперь в функциях text_DrawEx и text_DrawInRectEx шкала размерности производит масштаб согласно заданному размеру шрифта.
- исправлена ошибка при переключении рендеринга с фреймбуфера на экран.
- добавлены проекты "LightEngine2D" и "Particle editor".
- в модуле zgl_primitives_2d.pas изменены процедуры: pr2d_Circle и pr2d_Ellipse. Теперь с помощью этих функций, при сплошной заливке, можно менять градиент цвета от центра к краям.
и некоторые другие изменения.

Динамические библиотеки были пересобраны.

--------------------------------------------------------
Google translate:

Hello everyone!
Another update for --> ZenGL 0.4.17. <--

Quote
- fixed problems in many managers. Previously, an error could appear when the resource allegedly did not load/was not created.
- fixed a bug in the text_Draw function; this happened when using alignment and appeared when only one word was transferred.
- now in the text_DrawEx and text_DrawInRectEx functions the dimension scale produces a scale according to the specified font size.
- fixed an error when switching rendering from the framebuffer to the screen.
- added projects "LightEngine2D" and "Particle editor".
- in the module zgl_primitives_2d.pas the procedures pr2d_Circle and pr2d_Ellipse were changed. Now with the help of these functions, with a solid fill, you can change the color gradient from the center to the edges.
and some other changes.

Dynamic libraries have been rebuilt.

 8)
« Last Edit: March 05, 2025, 04:24:26 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #36 on: May 01, 2025, 10:03:34 pm »
Всем привет! ;)
Выпущено очередное обновление для -->ZenGL 0.4.18.<--
Quote
- Устранена утечка памяти для LCL/VCL приложений.
- Возвращены старые процедуры pr2d_Circle и pr2d_Ellipse. И "добавлены" новые pr2d_CircleEx и pr2d_EllipseEx - несут небольшое расширение для стандартных процедур, это возможность заливки разным цветом от центра к краям.
- Корректирован код для LightEngine2d.
- добавлены функции: u_ByteToHex, u_WordToHex, u_LWordToHex, u_ByteToBin, u_WordToBin и u_LWordToBin. В большинстве своём они нужны только для отладки.
- исправлены проблемы совместимости кода для OpenGL с кодом для OpenGL ES.
- добавлена процедура wnd_SetAutocenter - указывающая что дальшение изменения окна должны автоматически центрировать окно.
и некоторые другие изменения.

Динамические библиотеки были пересобраны (напоминаю, вы можете их собрать сами).
 :-[

-----------------------------------------------------------
Google translate:
Hello everyone! ::)
Another update has been released for -->ZenGL 0.4.18.<--
Quote
- Fixed a memory leak for LCL/VCL applications.
- Old procedures pr2d_Circle and pr2d_Ellipse have been returned. And new pr2d_CircleEx and pr2d_EllipseEx have been "added" - they carry a small extension for standard procedures, this is the ability to fill with different colors from the center to the edges.
- Corrected code for LightEngine2d.
- added functions: u_ByteToHex, u_WordToHex, u_LWordToHex, u_ByteToBin, u_WordToBin and u_LWordToBin. Mostly they are needed only for debugging.
- fixed compatibility issues of code for OpenGL with code for OpenGL ES.
- added procedure wnd_SetAutocenter - indicating that further changes to the window should automatically center the window.
and some other changes.

Dynamic libraries were rebuilt (remember, you can build them yourself).
 :-[
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

fcu

  • Full Member
  • ***
  • Posts: 118
Re: ZenGL +android + MacOS Cocoa
« Reply #37 on: May 02, 2025, 02:57:02 pm »
hi seenkao  , i still couldn't compile the particle editor , got some error messages related to pr2d_Circle function
can you check please ?

i am using Lazarus 4 RC3 with FPC 3.2.2 64bits on windows 10 64bits   

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #38 on: May 02, 2025, 05:01:07 pm »
fcu, благодарю за информацию!
Пока удалите в модуле "Zenrender.pas" в вызовах "pr2d_circle" второй "newColor[0]" второй "cl_Red" (если не удалите, процедура может не правильно работать).
Должно получиться:
"pr2d_circle(emitter.Params.Position.X + EndX, emitter.Params.Position.Y + EndY, 5, newColor[0], 16, PR2D_FILL);"
и
"pr2d_circle(emitter.Params.Position.X, emitter.Params.Position.Y, Tlength, cl_Red);"

Или замените все вызовы "pr2d_circle" на "pr2d_circleEx" (возможно это будет проще).

Я cделаю первый вариант и перезалью ZenGL.


Google translate:
fcu, thanks for the info!
For now, delete the second "newColor[0]" and the second "cl_Red" in the "pr2d_circle" calls in the "Zenrender.pas" module (if you don't, the procedure may not work correctly).
You should get:
"pr2d_circle(emitter.Params.Position.X + EndX, emitter.Params.Position.Y + EndY, 5, newColor[0], 16, PR2D_FILL);"
and
"pr2d_circle(emitter.Params.Position.X, emitter.Params.Position.Y, Tlength, cl_Red);"

Or replace all "pr2d_circle" calls with "pr2d_circleEx" (maybe it will be easier).

I will make the first version and reupload ZenGL.

Re-uploaded, you can just download it.
« Last Edit: May 02, 2025, 05:10:52 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

fcu

  • Full Member
  • ***
  • Posts: 118
Re: ZenGL +android + MacOS Cocoa
« Reply #39 on: May 02, 2025, 07:20:43 pm »
thanks
now i have problem building zengl.dll 32bits version
this is the error message i got

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #40 on: May 02, 2025, 09:33:33 pm »
Code: Pascal  [Select][+][-]
  1. var
  2.   SetUserMode: procedure;

fcu, я извиняюсь, но я не могу получить вашей ошибки. Я не знаю по какой причине объявление для SetUserMode может определяться как LongWord.
Проверьте не давали ли вы ей случайно новое определение. Может что-то меняли в проекте?
На всякий случай напомню, для сборки динамической библиотеки для Windows надо пользоваться проектом ZenGL-win.


------------------------------------------
Google translate:
fcu, I'm sorry, but I can't get your error. I don't know why the declaration for SetUserMode can be defined as LongWord.
Check if you accidentally gave it a new definition. Maybe you changed something in the project?
Just in case, I'll remind you that to build a dynamic library for Windows, you need to use the ZenGL-win project.

Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

fcu

  • Full Member
  • ***
  • Posts: 118
Re: ZenGL +android + MacOS Cocoa
« Reply #41 on: May 02, 2025, 09:50:53 pm »
it seems that FPC trunk 3.3.1 could not build zengl
i switched to 3.2.2 and it work perfect   

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #42 on: May 02, 2025, 10:19:08 pm »
fcu, ранее вы писали, что использовали FPC 3.2.2:) Я и подумал, что собирали с его помощью.
Позже потестирую и для версии FPC 3.3.1. Может получится узнать в чём проблема (для Android приходилось уровень оптимизации понижать).

Хорошо, что вам всё удалось собрать! Успехов!


Google translate:
fcu
Earlier you wrote that you used FPC 3.2.2. :) I thought that you were compiling with it.
Later I will test for version FPC 3.3.1. Maybe I will be able to find out what the problem is (for Android I had to lower the optimization level).

It's good that you managed to compile everything! Good luck!
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 712
    • New ZenGL.
Re: ZenGL +android + MacOS Cocoa
« Reply #43 on: June 15, 2025, 08:57:55 pm »
Hi All! ;)
Выпущена новая версия --> ZenGL 4.19. <--
Изменения произошли достаточно глобальные и возможно версия не стабильна. Потому, если что, используйте предыдущую версию.

Основные изменения:
Quote
- изменена работа с загрузкой файлов. Теперь за счёт флага можно указать, что путь указан глобальный. Необходимо для LCL/VCL приложений, где используются OpenDialog и что-нибудь подобное.
- частицы: добавлены процедура и функция для передачи координат излучателя. В дальнейшем могут быть изменение их работы.
- изменена работа рендера. Исключена вся функциональность glBegin, glEnd, glVertex и другие из функциональности ZenGL. Теперь всё работает посредством использования glDrawArrays - кроссплатформенно по умолчанию.
- изменена работа с цветом. Теперь основа для цвета это zglTColor (zglPColor), ранее было LongWord.
- добавлены расширенные функции для рисования линии, в них можно задавать начальный и конечный цвет.
- множественные изменения согласно изменений выше.

Просьба сообщать о всех проблемах работы с библиотекой! Очень сложно всё протестировать. По возможности проверил всё что возможно, но наверняка что-то упустил.

Всем успехов! :)


-----------------------------------------------
Google translate:
A new version of --> ZenGL 4.19. <--
The changes are quite global and the version may not be stable. Therefore, if anything, use the previous version.

Major changes:
Quote
- the work with file loading has been changed. Now, due to the flag, you can specify that the path is global. Necessary for LCL/VCL applications that use OpenDialog and something similar.
- particles: a procedure and a function for transmitting emitter coordinates have been added. In the future, their work may change.
- the renderer has been changed. All glBegin, glEnd, glVertex and other functionality from ZenGL functionality has been excluded. Now everything works using glDrawArrays - cross-platform by default.
- color handling has been changed. Now the basis for color is zglTColor (zglPColor), previously it was LongWord.
- extended functions for drawing a line have been added, you can set the start and end color in them.
- multiple changes according to the changes above.

Please report any problems with the library! It is very difficult to test everything. I checked everything I could, but I probably missed something.

Good luck to everyone! :)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

 

TinyPortal © 2005-2018