Recent

Author Topic: ZenGL Update +android + MacOS Cocoa + Green Engine  (Read 15369 times)

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #15 on: July 18, 2021, 08:28:28 am »
Сразу же внёс корректировки для MacOS Cocoa.
- оказывается, что в версии 3.27 была удалена часть кода. Как раз для MacOS.
- и так же оказалось, что в MacOS Cocoa нет "отжатия" клавиши "CapsLock". Ориентируйтесь в ZenGL только на нажатие этой клавиши.
(демки новой версии ZenGL для MacOS могут не работать - в ближайшее время исправлю. Для ZenGL 3.27 - работают)

Google translate:
Immediately made adjustments for macOS Cocoa.
- it turns out that in version 3.27 part of the code was removed. Just right for macOS.
- and it also turned out that in MacOS Cocoa there is no "release" of the "CapsLock" key. Focus only on pressing this key in ZenGL.
(demos of the new version of ZenGL for MacOS may not work - I will fix it in the near future. For ZenGL 3.27 - they work)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #16 on: February 27, 2022, 12:48:20 am »
Привет!
Выпущена новая версия ZenGL 3.29.
 8)
Изменения в файле Update_ZenGL.txt.

Основное из изменений: В ZenGL включён полный OpenGL по состоянию на конец 2021 года. По умолчанию включена минимальная версия, для использования основной функциональности ZenGL. Для использования полного OpenGL вам надо будет отключить в файле GLdefine.cfg дефайн USE_MIN_OPENGL (смотрите первую демо версию).

Окно и контекст окна создаются автоматически. Работу с View-портом надо настраивать. Эти функции были сделаны ещё Andru, для 2D под ZenGL подойдёт (может и вам подойдёт), для 3D надо самим настраивать функцию.
Займусь этим немного позже. Вы можете сами что-нибудь предложить.

Демки переделаны только под Lazarus, поэтому все изменения смотрите в них.

Демка LCL не будет работать в Windows 10. Я пока не решал этой проблемы. Зависает окно.

------------------------------------------------------------------------------------------------------------------------------------
Google translate:
Hey!
New version ZenGL 3.29 has been released.
 8)
Changes in the file Update_ZenGL.txt.

Key changes: ZenGL includes full OpenGL as of late 2021. By default, a minimum version is enabled to use the core functionality of ZenGL. To use full OpenGL you will need to disable USE_MIN_OPENGL in the GLdefine.cfg file (see the first demo).

The window and window context are created automatically. Work with the View-port must be configured. These functions were made by Andru, for 2D under ZenGL it will work (maybe it will work for you too), for 3D you need to configure the function yourself.
I'll deal with this a little later. You can offer something yourself.

Demos are remade only for Lazarus, so look at all the changes in them.

The LCL demo won't work on Windows 10. I haven't solved this problem yet. The window hangs.
« Last Edit: February 28, 2022, 08:38:42 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #17 on: February 28, 2022, 08:41:39 pm »
Обновил репозиторий.

Все демки обновлены. Исправлены баги и недочёты. С Windows 10 разобрался. Там проблемы с таймерами и обработкой внутреннего цикла ZenGL.

Если собираетесь работать с LCL, то во многих вызываемых процедурах надо выключать/включать таймер, чтобы не накладывались события друг на друга. Я понимаю, что это не лучший способ, но меня честно не интересовал LCL, поэтому это только возможное рабочее решение. Вы можете попробовать делать это без таймера.

Так же, если используете LCL, то забудьте об обработке мыши и клавиатуры средствами ZenGL, используете средства LCL.

Для FreePascal-демок вам придётся самим прописать путь до FPC в маке-файле.

--------------------------------------------------------------------------------------------------------------
Google translate:
Updated the repository.

All demos have been updated. Fixed bugs and shortcomings. Got it with Windows 10. There are issues with timers and ZenGL inner loop handling.

If you are going to work with LCL, then in many called procedures you need to turn off / turn on the timer so that events do not overlap each other. I realize this isn't the best way, but I honestly wasn't interested in LCL, so this is only a possible working solution. You can try doing this without a timer.

Also, if you use LCL, then forget about mouse and keyboard processing with ZenGL tools, use LCL tools.

For FreePascal demos, you will have to write the path to the FPC in the makefile yourself.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #18 on: March 28, 2022, 07:44:40 pm »
Обновлена текущая версия ZenGL.
На видео показано два варианта прямой работы с OpenGL. Определённый код можно вынести в отдельный модуль для использования в разных проектах. Например матрицы, загрузку шейдеров, создание буферов.
Код пока только на видео, при необходимости могу выложить на GitHub.  ;D

Google translate:
Updated current version of ZenGL.
The video shows two options for working directly with OpenGL. Certain code can be moved to a separate module for use in different projects. For example matrices, loading shaders, creating buffers.
The code is only on video so far, if necessary, I can put it on GitHub. ;D
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Handoko

  • Hero Member
  • *****
  • Posts: 4833
  • My goal: build my own game engine using Lazarus
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #19 on: March 28, 2022, 08:00:23 pm »
Thank you for the update.

ZenGL was very interesting for me, I found it some years ago when I was looking for a game/graphics engine. Unfortunately, I heard the original author had abandoned it. Was it true?

How to make ZenGL work on Android? Is it difficult? Using LAMW? I mean, I was a fan of LAMW and I wanted to do graphics things on Android. Unfortunately LAMW's jCanvasES1 and jCanvasES2 both had serious bugs make them unusable for real projects. I ever posted the issues but no one can fix them. If I can make Android games using Lazarus + ZenGL, I will be a fan of ZenGL.
« Last Edit: March 28, 2022, 08:07:38 pm by Handoko »

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #20 on: March 28, 2022, 08:26:08 pm »
Подождите немного, мне надо подготовить информацию, особенно на английском языке.  :)
Да, автор занялся своими делами и перешёл на ЯП C/C++. И это было очень давно. Дальнейшая разработка ZenGL мной, была с ним согласована. Он был не против.

google translate:
Wait a bit, I need to prepare information, especially in English. :)
Yes, the author went about his business and switched to C/C++. And that was a very long time ago. Further development of ZenGL by me was agreed with him. He didn't mind.
« Last Edit: March 28, 2022, 08:29:05 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #21 on: March 29, 2022, 03:43:21 pm »
ANDROID

Похоже пора пробежаться по тому как разрабатывать под Android на английском языке...  :-[

Что нужно знать. ZenGL на данное время собирает только 32-х битные приложения. Не по той причине, что не возможно собрать 64-х битное приложение, а по той причине, что не хватает динамических библиотек для 64-х битного приложения. Так же не хватает библиотек для платформы x86/64. Часть из них собрана, а часть уже невозможно собрать и надо либо отказываться от них (как временное решение) или делать их замену другими библиотеками.

Так же стоит знать, что ZenGL использует OpenGL ES 1(1.1). На данное время идёт работа над включением в ZenGL - OpenGL ES 2.0 и выше. И так же надо будет создавать контекст для данной версии.

Начнём.

ZenGL собирает проект из java файлов и нативных библиотек собранных ранее и нативной библиотеки рабочего проекта (например демок идущих с ZenGL).

Я собирал конечный проект в Eclipse. Использовалась java 8 (вероятнее всего можно и с новыми версиями, но я всё же за стабильность). Как настроить Eclipse для работы с Android примеров полно в интернете. Можно использовать старые версии Eclipse, если вас это сильно не беспокоит.

Рассмотрим любую из демок, которые есть в папке Android.
Импортируем папку с проектом в Eclipse.
Quote
File -> Import -> (Android -> Existing Android Code Into Workspace) Next
Root directory -> Browse
... выбираем папку проекта ... -> OK
Finish
Открываем Lazarus и в нём "Открыть проект", заходим в ту же папку, которую импортировали в Eclipse. Далее заходим в папку jni и открываем сам проект. Компилируем.
Тут могут возникнуть ошибки. В первую очередь это то, что нам надо в проводнике открыть папку проекта, зайти в папку jni и запустить файл windows_prebuild.bat или linux_prebuild.sh - в зависимости от вашей системы.
Внимание! Некоторых папок может не хватать, в связи с моей халатностью, я их когда-то удалил, считая что они не нужны. Потому в папке проекта должны быть папки assets и libs/armeabi. В эти папки будут копироваться необходимые файлы для проекта.

Дальше по ошибкам возникающим. В проекте могут быть не прописаны определённые пути (не за всем могу уследить), потому надо прописывать пути до папок: src, srcGL, srcGEGL. Так же для Android возможно вам необходимо будет указать пути до нативных библиотек NDK.

Компилируем ещё раз. На этом этапе компиляция должна пройти успешно. Если все пути правильно прописаны.
Из папки jni копируем файл libdemoN.so в папку libs/armeabi.
Заходим в Eclipse, обновляем проект. Запускаем. Он должен пройти сборку и на выходе в папке bin будет готовый APK-файл.


Google translate:
Looks like it's time to go over how to develop for Android in English... :-[

What you need to know. ZenGL currently builds only 32-bit applications. Not for the reason that it is not possible to build a 64-bit application, but for the reason that there are not enough dynamic libraries for a 64-bit application. There are also not enough libraries for the x86/64 platform. Some of them are assembled, and some are no longer possible to assemble and you must either abandon them (as a temporary solution) or replace them with other libraries.

It's also worth knowing that ZenGL uses OpenGL ES 1(1.1). At this time, work is underway to include in ZenGL - OpenGL ES 2.0 and higher. And it will also be necessary to create a context for this version.

Let's start.

ZenGL builds the project from java files and native libraries built earlier and the native library of the working project (eg demos coming with ZenGL).

I built the final project in Eclipse. Java 8 was used (most likely it is possible with new versions, but I'm still for stability). How to set up Eclipse to work with Android is full of examples on the Internet. You can use older versions of Eclipse if that doesn't bother you too much.

Consider any of the demos that are in the Android folder.
Importing the project folder into Eclipse.
Quote
File -> Import -> (Android -> Existing Android Code Into Workspace) Next
Root directory -> Browse
... select project folder ... -> OK
Finish
Open Lazarus and in it "Open project", go to the same folder that we imported into Eclipse. Next, go to the jni folder and open the project itself. Compiling.
There may be errors here. First of all, this is what we need to open the project folder in the explorer, go to the jni folder and run the windows_prebuild.bat or linux_prebuild.sh file - depending on your system.
Attention! Some folders may be missing, due to my negligence, I once deleted them, believing that they are not needed. Therefore, the project folder should contain the assets and libs/armeabi folders. The necessary files for the project will be copied to these folders.

Further on errors arising. Certain paths may not be registered in the project (I can’t follow everything), therefore it is necessary to register the paths to the folders: src, srcGL, srcGEGL. Also for Android, you may need to specify the paths to the native NDK libraries.

Let's compile again. At this point, compilation should succeed. If all paths are correct.
Copy the libdemoN.so file from the jni folder to the libs/armeabi folder.
We come into Eclipse, we update the project. We launch. It must go through the assembly and the output in the bin folder will be the finished APK file.
------------------------------------------------------------------------------

Что ещё нужно знать. Если вы хотите собирать проекты под  Android прямо сейчас, то вам лучше выбрать версию 3.25 или 3.27.
Последнюю версию я не редактировал под Android потому при сборке проектов очень много проблем, в том числе и не согласованного с новым кодом. Часть из них я уже решил и какие-то демки я смогу уже сегодня редактировать, для возможности их использования как примеров.
Я оповещу об этом.

Вероятнее всего проекты можно собрать и другим путём. Но я не стал сильно вдаваться в эти возможности.

Google translate:
What else do you need to know. If you want to build projects for Android right now, then you'd better choose version 3.25 or 3.27.
I did not edit the latest version for Android, so there are a lot of problems when building projects. I have already solved some of them and I can already edit some demos today to be able to use them as examples.
I'll let you know about it.

Most likely, projects can be collected in another way. But I didn't go into those possibilities too much.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Handoko

  • Hero Member
  • *****
  • Posts: 4833
  • My goal: build my own game engine using Lazarus
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #22 on: March 29, 2022, 04:13:49 pm »
Thank you for the tutorial.

I built the final project in Eclipse. Java 8 was used ...

That's the problem. I am only a hobbyist, I do not have much time to learn something new. I wish I have because there are already a long list of things I want to study: Castle Game Engine, Python, PHP, C++, Vulcan, etc. I ever spent some time to try Java, the language seemed too weird to me.  %)

Have you tried LAMW. Maybe you can make ZenGL as a component tobe able to used in LAMW. I am currently learning OpenGL, hope someday I can fix he OpenGL issue in LAMW. You're good in OpenGL, perhaps you can help fixing the bugs:
https://forum.lazarus.freepascal.org/index.php/topic,32951.msg212717.html#msg212717
https://forum.lazarus.freepascal.org/index.php/topic,39714.msg280170.html#msg280170
« Last Edit: March 29, 2022, 04:16:04 pm by Handoko »

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #23 on: March 29, 2022, 05:03:27 pm »
Thank you for the tutorial.
  :)

Quote
That's the problem. I am only a hobbyist, I do not have much time to learn something new. I wish I have because there are already a long list of things I want to study: Castle Game Engine, Python, PHP, C++, Vulcan, etc. I ever spent some time to try Java, the language seemed too weird to me.  %)
На самом деле это не так трудно, как кажется. Вам даже java изучать не нужно. Нужно настроить Eclipse один раз и с его помощью собирать проекты. А весь java-код я старался уже привести к нужному виду. И тогда, когда появится больше времени, можно будет изучать java и включать дополнения. Хотя наверняка и в LAWM то же самое может быть, он удобнее тем, что не надо две оболочки запускать. Делает он так же java-код, смешивая с нативным. И вполне возможно, зная java, можно собрать более корректное приложение.

По первой ссылке - на взгляд там неправильное определение матриц. Должно быть что-то вроде этого:

google translate:
It's actually not as difficult as it seems. You don't even need to learn Java. You need to set up Eclipse once and use it to build projects. And I tried to bring all the java code to the desired form. And then, when more time appears, it will be possible to study java and include additions. Although for sure the same thing can happen in LAWM, it is more convenient because you do not need to run two shells. He does the same java code, mixing with native. And it is quite possible, knowing java, you can build a more correct application.

According to the first link - it looks like there is an incorrect definition of matrices. Should be something like this:
Code: Pascal  [Select][+][-]
  1. glMatrixMode(GL_PROJECTION);
  2.   glLoadIdentity();
  3.   gluPerspective(oglFOVY, oglWidth / oglHeight, oglzNear, oglzFar);
  4.   glMatrixMode(GL_MODELVIEW);
  5.   glLoadIdentity();

Я извиняюсь, но по второй ссылке ни чем помочь не могу. Там надо влазить в LAWM смотреть как это устроено... А я и так при установке давным давно перелопачивал его для себя, чтоб запустить. Разработчик на то что я сделал ни чего не ответил, потому я просто забил. ))) Сам LAWM достаточно интересен, для быстрой сборки проектов. Собирает он достаточно небольшие приложения, но меня почему-то не очень это увлекло.
google translate:
I'm sorry, but I can't help you with the second link. There you need to get into LAWM to see how it works ... And so, during the installation, a long time ago I shoveled it for myself in order to launch it. The developer did not answer what I did, so I just scored. ))) LAWM itself is quite interesting for quick assembly of projects. It collects fairly small applications, but for some reason I was not very interested in it.
« Last Edit: March 29, 2022, 05:13:28 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Handoko

  • Hero Member
  • *****
  • Posts: 4833
  • My goal: build my own game engine using Lazarus
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #24 on: March 29, 2022, 05:32:31 pm »
According to the first link - it looks like there is an incorrect definition of matrices. Should be something like this:
Code: Pascal  [Select][+][-]
  1. glMatrixMode(GL_PROJECTION);
  2.   glLoadIdentity();
  3.   gluPerspective(oglFOVY, oglWidth / oglHeight, oglzNear, oglzFar);
  4.   glMatrixMode(GL_MODELVIEW);
  5.   glLoadIdentity();

I will certainly try it when I have time. I haven't use LAMW for a very long time and it is not installed on my computer.

It's actually not as difficult as it seems. You don't even need to learn Java. You need to set up Eclipse once and use it to build projects.

But then I will need to learn the Android framework and learn how to 'call' them in FPC. LAMW is not perfect but what I like most is it already has plenty of ready-to-use components, I can simple write code in Pascal and almost no need to deal about the Android framework.

Anyways, thank you for the information. I might try to learn what you suggested if I have time.

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #25 on: March 29, 2022, 05:54:51 pm »
But then I will need to learn the Android framework and learn how to 'call' them in FPC. LAMW is not perfect but what I like most is it already has plenty of ready-to-use components, I can simple write code in Pascal and almost no need to deal about the Android framework.

Anyways, thank you for the information. I might try to learn what you suggested if I have time.
Я думаю вам надо попробовать! Не попробуешь, не узнаешь о чём идёт речь. Вам даже не обязательно знать фреймворки Android для того чтоб пользоваться ZenGL.
Я тоже им не сразу стал пользоваться. :)
google translate:
I think you should try! If you don't try, you won't know what it's all about. You don't even need to know Android frameworks to use ZenGL.
I didn't use it right away either. :)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #26 on: May 06, 2022, 01:50:42 pm »
Обновлена последняя версия ZenGL. И стабилизирована для работы с Android.
Исправлены мелкие недочёты.
Возможны мелкие ошибки, просьба сообщать, для скорейших исправлений.

Google translate:
Updated the latest version of ZenGL. And stabilized to work with Android.
Fixed minor bugs.
There may be minor errors, please report, for speedy corrections.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

loaded

  • Hero Member
  • *****
  • Posts: 757
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #27 on: May 06, 2022, 02:41:15 pm »
Seenkao
Updated the latest version of ZenGL. And stabilized to work with Android. Fixed minor bugs. There may be minor errors, please report, for speedy corrections.
Thank you so much for your hard work and effort.
If Ide=Lazarus 2.2.4 32 Bit and Os=Win 10 Home 64 Bit 22H2 then Get up and do something useful! Because God is the helper of those who start again;

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #28 on: May 21, 2022, 09:43:17 pm »
loaded, thank!

----------------------------------------------
На данное время думаю как реализовать демо-версию, для показа реализации джойстиков для Android и возможности их использования.

Gogle translate:
At this time, I'm thinking about how to implement a demo to show the implementation of joysticks for Android and the possibility of using them.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

Seenkao

  • Sr. Member
  • ****
  • Posts: 446
    • New ZenGL.
Re: ZenGL Update +android + MacOS Cocoa + Green Engine
« Reply #29 on: March 15, 2023, 12:14:03 pm »
Привет!

  Вышла новая версия ZenGL 3.30. Изменений достаточно немало и я не смогу их все упомнить. Всё постарался записать в файле Update_ZenGL.txt (к сожаленью только на Русском языке, прошу простить, но документацию стараюсь поддерживать и на Английском! ::)).
  Основные изменения это то, что теперь для мобильных систем работает нативная клавиатура и она не зависит от системы!!! Её можно использовать как виртуальную клавиатуру для настольных ОС. Но вот про джойстики для мобильных систем - забыл... Они не доделаны.
  Клавиатура поддерживает кириллицу и латиницу. Для поддержки других раскладок клавиатур нужна помощь носителей данных языков. Если кого заинтересует, обращайтесь.

Google translate:
Hello!

   New version ZenGL 3.30 has been released. There are so many changes that I can't remember them all. I tried to write everything in the file Update_ZenGL.txt (unfortunately, only in Russian, I'm sorry, but I try to support the documentation in English too! ::)).
   The main changes are that now a native keyboard works for mobile systems and it does not depend on the system!!! It can be used as a virtual keyboard for desktop OS. But I forgot about joysticks for mobile systems... They haven't been completed yet.
   The keyboard supports Cyrillic and Latin. Support for other keyboard layouts requires the assistance of native speakers of these languages. If anyone is interested, please contact.

Sorry for my English. But it's a translator...

Всем успехов!  ;D
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.
Работаю над ZenGL.
Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL. :)

 

TinyPortal © 2005-2018