Forum



~Leuchtefix75 am 25.02.2018 13:56 #14889


There are a lot of ARMv7L copatible chips around, runing Linux.

The point I interested in, you can place an ARM based fanles boad nearly everywhere
and the hardware has anought power to run this game fluid.  
And at all, S2 is! the best Settlers game there ever was.

Facing two problems on the PI:
The GPU's aren't well supported by the OS and the propietary firmware not well documented.
The RTTR build doesn't support ARM chips and the GPU's as well. Even if, EGL/GLES is not openGL,
the lib's are shaped to fit with graphic harware.

I playing compiling with RPI 3b and BPI M1, both in ARMv7L mode, using this:

Code:

# specify the processor CMAKE is runnung at in ./s25client/CMakeLists.txt
ELSEIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
SET(PLATFORM_ARCH "arm") #there already is an unused ARM toolchain... like a kind of hope
ELSE()
SET(PLATFORM_ARCH "universal")

  
Code:

# in ./s25client/cmake/linux.cmake for armv7l ...but even to hashtag the existig lines should work
FORCE_ADD_FLAGS(CMAKE_C_FLAGS -Ofast -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard)
FORCE_ADD_FLAGS(CMAKE_CXX_FLAGS -Ofast -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard)


Code:

# if LUA dev 5.2 is not found, but installed ...I do it quick an dirty
cp /usr/lib/arm-linux-gnueabihf/liblua5.2.a /home/pi/s25client/contrib/lua/lin64/liblua52.a


# compiling 1-2 hours on one core (you only have 1GB RAM)
at all you will end up using a resolution 800x600 with 2-7 FPS on native X11 and up to 24 FPS with SDL-ovelay, if your CPU is that powerfull.
as you may recogniced, at this point all openGL stuff is emulated by the CPU, no GPU acceleration!
if you have an "optimiced" FBturbo installed, it can break the graphic output and the use of SIMD(NEON)


#links I find usefull:
/opt/vc/src/hello_pi
https://github.com/peepo/openGL-RPi-tutorial
https://pandorawiki.org/GLES
https://stackoverflow.com/questions/28375338/cube-using-single-gl-triangle-strip
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489e/CJAJIIGG.html
www.khronos.org/vulkan


Kind regards,
a ethusiast, not a programmer!

PS: My mind is a open wound. Don't even try to be sweet! I see this thread as my work-in-progress playground.

Editiert von FloSoft am 25.02.2018 21:18

Leuchtefix75 am 26.03.2018 21:51 #14909


A basic intelligence, called my own.
A sea of knowledge, called the World-Wide-Web.
So you must be the luck I still miss.

How I found you? Searching for __LUCK__!

Code:
find . 2>/dev/null | grep -F -r "__LUCK__"


Hack around the clock is tricky, tricky-tricky!
https://github.com/Leuchtefix75

glBegin is at an end, so replace it:
You define the vertex array outside and than tell the graphic API how to tread
it.
we are at 2D(x,y), typ is GL_INT, n Byte ofset per vertice, our array
could be modifed to 3D(x,y,z) seting the deep z=0

Code:

#void Window::Draw3D //used to draw a halftrasparent rectangle for mouseover
/*
    glDisable(GL_TEXTURE_2D);
...
    glEnable(GL_TEXTURE_2D);
*/

    GLubyte indices[] = {
    0,1,2, // first triangle (bottom left - top left - top right)
    0,2,3 // second triangle (bottom left - top right - bottom right)
    };
#   void Window::DrawRectangle(const Rect& rect, unsigned color)
    GLint rectx[] = {
    rect.left, rect.top,
    rect.left, rect.bottom,
    rect.right, rect.bottom,
    rect.right, rect.top
    };

    glVertexPointer(2, GL_INT, 0, rectx);
    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);

#void Window::DrawLine
    GLint linevx[] = {
    pt1.x, pt1.y,
    pt2.x, pt2.y
    };

    glVertexPointer(2, GL_INT, 0, linevx);
    glDrawElements(GL_LINES, 2, GL_UNSIGNED_BYTE, indices);


#./src/ogl/glArchivItem_Bitmap_Player.cpp
//    glDrawArrays(GL_QUADS, 0, 8); //Draw animation working
    glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
    glDrawArrays(GL_TRIANGLE_FAN, 4, 4);


On RPI you may think to implement the firmware like this...

Code:
FORCE_ADD_FLAGS(CMAKE_C_FLAGS -Ofast -mcpu=cortex-a7 -mfpu=neon-vfpv4 -
L/opt/vc/lib/ -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -
I/opt/vc/include/interface/vmcs_host/linux -D_REENTRANT -DTARGET_RPI -lGLESv2 -
lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread)

-fPIC -march=armv8-a+crc -mfloat-abi=hard -mfpu=neon-fp-armv8 -mtune=cortex-a53
-mvectorize-with-neon-quad -Ofast/g


...but than you realize your fail and want to return. But it fails again? Clean
you build-cache would do the trick!

Code:
ccache -c


how to use unmodified systems-cursor
Code:

# VideoSDL.cpp
CreateScreen
//    SDL_ShowCursor(SDL_DISABLE);
...
MessageLoop
Msg_RightDown
SDL_ShowCursor(SDL_DISABLE);
...
Msg_RightUp
SDL_ShowCursor(SDL_ENABLE);

#GameManager.cpp
GameManager::Run
//        DrawCursor();


To stop that hoping bunny, if the building quality is already visible
and half transparent...
My eyes like it that way!
Code:
#.src/world/GameWorldView.cpp
if(!show_bq && drawMouse && selPt == curPt)
bm->DrawFull(curPos,0xA0FFFFFF);


some modifications to the game defaults
Code:
#./src/GamePlayer.cpp
// percentage (tool-settings-window-slider, in 10th percent)
...values to zero

#./src/addons/AddonMetalworksBehaviorOnZero.h
"Produce nothing: RttR-Default"), 1)

#./src/figures/nofMetalworker.cpp
//    if(nextProducedTool == GD_NOTHING)        nextProducedTool =
GetRandomTool();

#./src/addons/AddonToolOrdering.h
_("Allows to order a specific amount of tools for priority production."), 1)


#./src/addons/AddonNoCoinsDefault.h
_("Receiving coins is disabled for military buildings by default."), 1)

#./src/addons/AddonCharburner.h
_("Allows to build the charburner."), 1)


If you want to 'make install' to a directory, as portable version
Code:
./cmake.sh --prefix=/home/pi/S25RTTR -DRTTR_TARGET_BOARD=RasPi3
# depends on ArmConfig.cmake

make install DESTDIR=$dirtoinstallto


Code:
# options for cmake.sh (picked from inside it)
-prefix | --prefix
-RTTR_BINDIR | --RTTR_BINDIR
-RTTR_DATADIR | --RTTR_DATADIR
-RTTR_LIBDIR | --RTTR_LIBDIR)
-arch | --arch | -target | --target | -toolchain | --toolchain
-no-arch | --no-arch
-generator | --generator
-enable-* | --enable-*
-disable-* | --disable-*
-D*

#options inside ./CMakeLists.txt
RTTR_ENABLE_OPTIMIZATIONS "Build with optimizing flags (such as -O2 and -ffast-
math added to CFLAGS and CXXFLAGS)" ON)
RTTR_ENABLE_COVERAGE "Generate coverage build" OFF)
RTTR_ENABLE_WERROR "Build with warnings turned into errors" ON)
RTTR_BUILD_EDITOR "Build editor." ON)
RTTR_BUILD_UPDATER "Build auto-updater. Not advised when changing the default
paths as the updater is configured specifically for the
official builds." ${RTTR_BUILD_UPDATER_DEF})
#for example
./cmake.sh -DRTTR_BUILD_EDITOR=OFF


Code:

#./CMakeLists.txt
CheckAndAddFlag

==== looks more promising than  ====

./cmake/linux.cmake
FORCE_ADD_FLAGS

==== even better choice: autoconf ====
But how to use it?


Editiert von Leuchtefix75 am 20.05.2019 19:34

FloSoft am 28.03.2018 14:02 #14914

Großmeister
Hi,

please send as a Pull-Request on github, so we can discuss your changes further.

---
mfg
Flo



Leuchtefix75 am 05.04.2018 03:17 #14924


And now for something completely different, ba-ba ba-ba, PIXMAN!

First: If you have a openGL driver that realy uses your GPU,
you don't need a software rastericer like PIXMAN. But it's nice to lear from building it.
You may have a look at http://pixman.org/ for a short explanation and aditional links.

Code:
git clone --recursive https://gitlab.freedesktop.org/pixman/pixman
...or...
git clone --recursive git://anongit.freedesktop.org/pixman
cd pixman
mkdir build
cd build
../autogen.sh --disable-arm-iwmmxt
# you may change in CONFIGURE the -O2 to -Ofast, best for ARM
make
sudo make install


1 GIT the first best
2 it has made a directory... cd in to it
3 make a subfolder for the build process
4 cd to it
5 start the automated environment configuration... you have to --disable-arm-iwmmxt
6 MAKE in userspace
7 replace the installed version by your own build
8 reboot you system... if it fails, use a copy of your OS, or try 'make uninstall'


OK, system start's, But what's the benefit?
Using the SIMD is like using an aditional core, specialized for 'pixel manipulation'.
If you don't use CAIRO or the X server, your system is probably not compatible with PIXMAN.

note:
.ko are kernel modules(drivers), the OS core
.so are The Other Ones, or an other Holiday

Editiert von Leuchtefix75 am 15.11.2019 14:05

Leuchtefix75 am 06.04.2018 19:18 #14925


...next step: GALLIUM Driver
Since 2015, the RPI Foundation stoped selling media codecs, thanks to
"nasty"
EU law, so 2016
Broadcom opened the VC4 specification, which led to a working openGL kernel-
modul/graphic-driver:

https://www.golem.de/news/raspberry-pi-bastelrechner-bekommt-pixel-desktop-
1609-123537.html

Code:
sudo rpi-update => reboot => sudo raspi-config
=> Advanced Options => GL Driver => GL (Full KMS)

...some other goodies...
#/boot/config.txt
avoid_warnings=2
audio_pwm_mode=2

#/boot/cmdline.txt
consoleblank=0 quiet swappiness=10

SUDO_ASKPASS=/usr/bin/pwdrcg.sh sudo -A rc_gui


Note:
When the dtoverlay=vc4-kms-v3d overlay is loaded you get cma=256M@256 added
to the kernel command line for free.
Memory allocated to the old graphics driver(gpu_mem) is wasted.
Contiguous-Memory-Allocator(if no MMU) provides virtual allocation.
The access to the real allocated memory gets solved by DMA transfer,
but can cause frame-errors if not available in time.

==== or the deprecated BCM_HOST stuff ====

Code:
# src/CMakeLists.txt
#RPI
SET(OPENGL_INCLUDE_DIR "/opt/vc/include")
CORRECT_LIB(OPENGL_gl_LIBRARY "/opt/vc/lib/libGLESv2.so")
ADD_FLAGS(CMAKE_EXE_LINKER_FLAGS -framework GLESv2)
SET(OGLEXT_INCLUDE_DIR "/opt/vc/include")


#BPI
SET(OPENGL_INCLUDE_DIR "/usr/include/GLES2")
CORRECT_LIB(OPENGL_gl_LIBRARY "/usr/lib/libGLESv2.so")
ADD_FLAGS(CMAKE_EXE_LINKER_FLAGS -framework GLESv2)
SET(OGLEXT_INCLUDE_DIR "/usr/include/GLES2")



Code:
// src/ogl/oglIncludes.h
#include "/opt/vc/include/GLES/gl.h"
#include "/opt/vc/include/GLES/glext.h"

#include "/opt/vc/include/GLES2/gl2.h"
#include "/opt/vc/include/EGL/egl.h"
#include "/opt/vc/include/EGL/eglext.h"

// src/ExtensionList.h
#define __APPLE__
#define GL_BGRA                           0x80E1
#define GL_COLOR_ARRAY                    0x8076
#define GL_COMBINE_EXT                    0x8570
#define GL_RGB_SCALE_EXT                  0x8573



void TerrainRenderer::DrawWays(const PreparedRoads& sorted_roads) const
# I stare at it with full force, so it must explain itself to me! Don't you
think?

Code:
#src/desktops/dskTextureTest.cpp
glColor3ub => glColor4ub (r,g,b,0xFF)


how to implement ARM_NEON, if it's supported by the compiler
Code:

clang -march=armv7 -dM -E -x c /dev/null | grep -i -E "(SIMD|NEON)"
gcc -mfpu=neon-vfpv4 -dM -E -x c /dev/null | grep -i -E "(SIMD|NEON)"

#ifdef __ARM_NEON
#include <arm_neon.h>
#endif /* __ARM_NEON */


Note:
EGL is the windowing part to GLES(3D) and openVG(2D)
https://www.tutorialspoint.com/cplusplus/cpp_this_pointer.htm

Editiert von Leuchtefix75 am 20.05.2019 17:04

Leuchtefix75 am 19.04.2018 18:33 #14930


And now for something completely different!

Yes, two years have past since I used BANANA-PI with a GUI.
Between there ran an IPFIRE(the successor of IPCOP) on it.
Have spend the day to prepare on my RPI an SD-card  with ARCH-LINUX for BANANA-PI.
Code:
https://wiki.archlinux.org/index.php/Banana_Pi#Install_basesystem_to_a_SD_card


ROOT rights needed
install: GCC-ARM-NONE-EABI, BSDTAR, SWIG, U-BOOT-TOOLS
GPARTED to make a new partitiontable on your /dev/sdX (X for where SD card is)
and formate one primary partition as EXT4
at host system create a dir as mount-point and mount the formated partition to transfer the
operating system image
Code:
cd /
mkdir mntp
mount /dev/sdX1 ./mntp
wget http://archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
bsdtar -xpf ArchLinuxARM-armv7-latest.tar.gz -C ./mntp/


Create a file with the following boot script
boot.cmd
Code:
part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
  if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
    if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
      bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
    else
      bootz ${kernel_addr_r} - ${fdt_addr_r};
    fi;
  fi;
fi

if load ${devtype} ${devnum}:${bootpart} 0x48000000 /boot/uImage; then
  if load ${devtype} ${devnum}:${bootpart} 0x43000000 /boot/script.bin; then
    setenv bootm_boot_mode sec;
    bootm 0x48000000;
  fi;
fi


Code:
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "BananPI boot script" -d boot.cmd
./mntp/boot/boot.scr
umount ./mntp


To build the U-Boot bootloader:
Code:
git clone git://git.denx.de/u-boot.git
cd u-boot
-delete the GCC version 0600 check in MAKEFILE
make ARCH=arm CROSS_COMPILE=arm-none-eabi- Bananapi_defconfig
make ARCH=arm CROSS_COMPILE=arm-none-eabi-

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8


IF you were patient, but the first start won't bring a display, you can try the reset- or power-
switch, or make a power-reset

Preset accounts are: root/root, alarm/alarm
You can change the password by passwd alarm for example

OK, now I have a headles(no GUI) disk-image ...with MESA(X11)? OK, will take the Ubuntu image, or

Code:
To update the package list:
pacman -Syu

To Install LXDE:
pacman -S lxde xorg-xinit xf86-video-fbdev

To run LXDE:
xinit /usr/bin/lxsession


Will patch it with:
https://developer.arm.com/products/software/mali-drivers/utgard-kernel
...which depends on the UMP User-Space driver! Trying to build the UMP can get a mess and in
mainline it's defined as deprecated.
May find a ready to install UMP driver with a how-to?
https://gist.github.com/kashimAstro/2708a2e420900249e7ae8bc44ff3a875
https://groups.google.com/forum/#!topic/linux-sunxi/R3nOsbF37yA
https://github.com/yuq/mesa-lima

I think this is still a treasure of the Web without 3D acceleration:
ArchLinux_For_BananaPi_v1412_eldajani.img.tar.xz
https://docs.google.com/uc?id=0BxWqJEu810QVVmgweHBSQ3FSdWs&export=download

http://kivypie.mitako.eu/kivy-faq.html

If Linux gets slow on high RAM usage/load, it could be due
Code:
https://en.wikipedia.org/wiki/Swappiness


Note: battery connectors for bananapi M1 (BAT1 for RTC, + is USB side, - SD card side)
https://www.symcon.de/forum/threads/28021-BananaPi

Editiert von Leuchtefix75 am 06.05.2018 14:11

Leuchtefix75 am 20.05.2018 11:45 #14955


How to replace deprecated openGL QUADS?

The only point it's hard to replace it in function, if there is a dynamic QUARD stripe like in:
Code:
src/TerrainRenderer.cpp
src/ogl/glArchivItem_Font.cpp



an example for a replacement:
./src/ogl/glArchivItem_Bitmap_Player.cpp
./src/ogl/glSmartBitmap.cpp
Code:
//  glDrawArrays(GL_QUADS, 0, 8);
    glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
    glDrawArrays(GL_TRIANGLE_FAN, 4, 4);


...or working with indices for reuse of vertices
./src/Window.cpp
Code:
    GLubyte indices[] = {  // defined outside the funktion, because it never get changed
    0,1,2,             // first triangle  (bottom left - top left  - top right)
    0,2,3              // second triangle (bottom left - top right - bottom right)
    };                 // the order is a little important to avoid back_face TRIANGLES
#   void Window::DrawRectangle(const Rect& rect, unsigned color)
    GLint rectx[] = {
    rect.left,  rect.bottom,
    rect.left,  rect.top,
    rect.right, rect.top
    rect.right, rect.bottom,
    };

    glVertexPointer(2, GL_INT, 0, rectx);
    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);



I would realy appreciate if all direct grafhic API(openGL) access would be done in the .SO file, even more in one source file,
to maintain the stuff and S25MAIN only access abstractions.

Editiert von Leuchtefix75 am 20.05.2018 20:56

Flamefire am 20.05.2018 13:57 #14956


I don't mind replacing all deprecated OpenGL stuff. In fact I actually want to switch to custom shaders as IMO we don't need to support those damn old PCs that don't support shaders.

What I would need is something to flag all deprecated usages or stuff that would not work in OpenGLES. Is there a flag/switch/tool to do that at least on linux?

---
Github: https://github.com/Flamefire


Leuchtefix75 am 20.05.2018 23:13 #14957


It's not quit deprecated, it's just not implemented.
Probably there are tools like plugins, so you can set a switch for a dedicated environment with a dedicated version.

But let explain the motivation!
If I'm right, the openGL KMS driver for RPI seams to be symbolic linked and has some issues with pointers causing allocation errors.
But it supports all the GL stuff from the sourcecode. So on RPI it is at playable speed, but can crash on maps over 96x96.

With the default MESA openGL driver the game is compileable everywhere. But if the game runs at 3FPS you wont play it.
So on non RPI it is still interesting to use the GLESv2 libs. Another issue is the EGL context in a X11 environment.

I like this example, even I don't realy get it. Maybe it can help you too?
https://github.com/peepo/openGL-RPi-tutorial

ARMv7l and GLESv2... we get closer!


Flamefire am 21.05.2018 12:21 #14959


I know. The point is: OpenGLES is basically an OpenGL without the deprecated stuff (like Quad-drawing). The whole fixed-function-pipeline is deprecated and the shader-based stuff might even be faster and now better supported.

So thats why I want some tool to show all deprecated stuff of OGL

---
Github: https://github.com/Flamefire


Leuchtefix75 am 21.05.2018 19:51 #14960


Was für ein Veränkespiel!
Nagut, beschmutzen wir die mir auserkorene Spielwiese, die ich im wesentlichen als Gedankenstütze für meine S25 Forschungen nutze.

Da ich den Sourcecode nur modifiziere und eigentlich überhaupt nichts mit Programmierung, geschweige Programmiersprachen zu tun habe,
bin ich mit meinem Wissen gerade so weit, wie ich es hier erfasse.

Gut, ich verstehe was du gern hättest, aber weiß das ich dafür nicht unbedingt der geeignete Ansprechpartner bin.
Am zielführendsten dürfte es wohl sein, sich ein System(HW +SW) zu schaffen und dann zu beginnen zu debuggen.
Sicher gibt es auch für x86_64 basierende Systeme eine GLESv2 Umgebung zum Installieren?
Oder man verwendet einfach nur mal die Header ohne die Libs und schaut was nicht mehr definiert ist?
Ansonsten entspann dich und schau wie es sich entwickelt.

Man kann natürlich auch mit dem Bisherigen brechen und die Routinen völlig neu schreiben, mit einem neuen Konzept.
Z.B. könnten auch nicht-openGL Videomodule gebaut werden, wie für Vulkan, was für MALI multi-core interessant wäre.
Es bedeutet ja nicht das du das alles selbst machen mußt, nur die Möglichkeit in Form von Schnittstellen schaffen, mehr nicht.

Für den Moment hack ich einfach in meinen Gegebenheiten und versuche es mit GLESv2 gangbar zu machen, da der Rest soweit funktioniert.
Ich denke das mein Fork da genau das richtige Mittel ist, um es überall runterladen zu können und weiter zu bearbeiten.
Das Game zu bauen ist für mich ein Spiel bei dem ich nicht verlieren kann, solange ich ein Backup habe.

Für den Anfang wäre es erstmal wichtig in eurem GIT:
- das LUA Problem scheint behoben zu sein, Haken dran
- FATAL_ERROR "Unknown processor arch" darf nicht für native-compiling gelten
- -DRTTR_ENABLE_OPTIMIZATIONS=OFF als Default,
  oder nochmal einen Filter vor FORCE_ADD_FLAGS setzen:
  IF(("${PLATFORM_ARCH}" STREQUAL "x86_64") OR ("${PLATFORM_ARCH}" STREQUAL "i386"))
- Hinweis: openGL driver besorgen, z.B. unter Linux über MESA, um das Game überhaupt erstmal laufen zu sehen

...
  Man kann sich wohl statt dem auch GLES2-MESA besorgen und dann mit den proprietären Binaries ersetzen?


Flamefire am 21.05.2018 22:23 #14961


Das Processor arch und die flags werde ich noch machen. Das dauert aber etwas, da ich das gleich richtig machen will.

Ich hoffe ja, dass wir bald C++11 und SDL2 bekommen. Das dürfte auch OpenGLES einfacher machen.

---
Github: https://github.com/Flamefire


Leuchtefix75 am 22.05.2018 22:24 #14962


Wenn du weißt wie "gleich richtig" geht? Ich bin immer noch am These aufstellen und gegenprüfen.

Aber -march=armv7-a und compiler arm-none-eabi sollte schon mal einen cross-build ermöglichen.
NONE bedeutet wohl nicht für einen Speziellen CPU-Chip und -EABI steht für bare-matel, während nur -ABI ein OS voraussetzt.  
openGL kann ja für den Build erstmal bleiben und sollte sogar auf dem RPI mit KMS driver spielfähig sein.
Bei GLES wird man wohl, außer das er GLESv2 benutzen soll, standard openGL disablen,
als auch den Pfad für die Lib's und die Pfade für die Header explizit angeben müssen.
Ich steck nur nicht so weit in Linux, um die Systemkonfiguration gleich anzupassen.

SDL2 kann wohl GLESv2 benutzen, was nicht bedeutet das es das mitbringt, sondern das du immer noch die GLES Header und die Lib's brauchst, um etwas zu compilieren?
Und dann siehst du was geht und was nicht.

Das mistige sind immer die leicht geänderten Namen für letztendlich die gleichen Werte.
Und ich seh bei dem Includen in einer bestimmten Reihenfolge, bzw. beim Kaskadieren von Headern nicht recht durch.
Wann mach ich besser einen extra Header für Header, wann bind ich sie direkt im C/C++-file ein?

Da du mich nun schon mal in meinem Streben aufhälst, wie kann ich eigentlich den FPS-counter auf die linke Ecke bringen und die anderen counter verschwinden lassen?

note:
https://wiki.libsdl.org/MigrationGuide

Editiert von Leuchtefix75 am 13.06.2018 12:35

Leuchtefix75 am 14.06.2018 16:52 #14976


__APPLE__ geht schon etwas in die richtige Richtung, bis auf das wirklich APPLE spezifische.

Ich spiel mit MESA_GLES2 in oglIncludes.h bisschen rum.
Code:

// #include <GL/gl.h>
// #include <GL/glext.h>

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

...or...

#define GL_GLEXT_PROTOTYPES
#include <SDL2/SDL_opengl.h>
#include <SDL2/SDL_opengl_glext.h>

Versuche PFNGL* auszuklammern und _ARB/ARB durch "" zu ersetzen.

How to get This to that?
Code:

GL/glext.h:
GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );

SDL2/SDL_opengles2_gl2.h:
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);


Code:
GLfloat coords[4][2];
coords[0][0] = 0;
coords[0][1] = 0;
coords[1][0] = 1;
coords[1][1] = 0;
coords[2][0] = 1;
coords[2][1] = 1;
coords[3][0] = 0;
coords[3][1] = 1;

and then I tried to put it into my shader where I have a attribute vec2 texcoordIn

GLint texcoord = glGetAttribLocation(shader->programID(), "texcoordIn");
glEnableVertexAttribArray(texcoord);
glVertexAttribPointer(
texcoord,
2, /* two components per element */
GL_FLOAT,
GL_FALSE, /* don't normalize, has no effect for floats */
0, /* distance between elements in sizeof(char), or 0 if tightly packed */
coords);



Note:
SDL2 & ES2
https://gist.github.com/SuperV1234/5c5ad838fe5fe1bf54f9

SDL using ANGLE, which simulates ES2 using Direct3D 9
https://discourse.libsdl.org/t/opengl-es2-support-on-windows/20177

noch mehr openGL demos
http://voidptr.io/blog/2016/04/28/ldEngine-Part-1.html

https://open.gl/drawing

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawArrays.xhtml

Cheat: winter
Code:

#build/driver/video/SDL/src/CMakeFiles/videoSDL.dir/build.make

lib/driver/video/libvideoSDL.so: driver/video/SDL/src/CMakeFiles/videoSDL.dir/VideoSDL.cpp.o
lib/driver/video/libvideoSDL.so: driver/video/SDL/src/CMakeFiles/videoSDL.dir/__/__/__/src/DriverInterface.cpp.o
lib/driver/video/libvideoSDL.so: driver/video/SDL/src/CMakeFiles/videoSDL.dir/build.make
lib/driver/video/libvideoSDL.so: driver/src/libvideodrv.a
lib/driver/video/libvideoSDL.so: libutil/src/libs25util.a
lib/driver/video/libvideoSDL.so: /usr/lib/arm-linux-gnueabihf/libSDLmain.a
lib/driver/video/libvideoSDL.so: /usr/lib/arm-linux-gnueabihf/libSDL.so
lib/driver/video/libvideoSDL.so: common/libs25Common.a
lib/driver/video/libvideoSDL.so: libutil/src/libs25util.a
lib/driver/video/libvideoSDL.so: libendian/src/libendian.a
lib/driver/video/libvideoSDL.so: libutil/nowide/src/libnowide.a
lib/driver/video/libvideoSDL.so: /usr/lib/arm-linux-gnueabihf/libboost_system.so
lib/driver/video/libvideoSDL.so: /usr/lib/arm-linux-gnueabihf/libboost_filesystem.so
lib/driver/video/libvideoSDL.so: /usr/lib/arm-linux-gnueabihf/libboost_random.so
lib/driver/video/libvideoSDL.so: /usr/lib/arm-linux-gnueabihf/libminiupnpc.so
lib/driver/video/libvideoSDL.so: driver/video/SDL/src/CMakeFiles/videoSDL.dir/link.txt


Code:
#./driver/video/SDL/src/VideoSDL.h
public:
    VideoSDL(VideoDriverLoaderInterface* CallBack);
    ~VideoSDL() override;
    /// Funktion zum Auslesen des Treibernamens.
    const char* GetName() const override;
    /// Treiberinitialisierungsfunktion.
    bool Initialize() override;
    /// Treiberaufräumfunktion.
    void CleanUp() override;
    /// Erstellt das Fenster mit entsprechenden Werten.
    bool CreateScreen(const std::string& title, const VideoMode& newSize, bool fullscreen) override;
    /// Erstellt oder verändert das Fenster mit entsprechenden Werten.
    bool ResizeScreen(const VideoMode& newSize, bool fullscreen) override;
    /// Schliesst das Fenster.
    void DestroyScreen() override;
    /// Wechselt die OpenGL-Puffer.
    bool SwapBuffers() override;
    /// Die Nachrichtenschleife.
    bool MessageLoop() override;
    /// Funktion zum Auslesen des TickCounts.
    unsigned long GetTickCount() const override;
    /// Funktion zum Holen einer Subfunktion.
    void* GetFunction(const char* function) const override;
    /// Listet verfügbare Videomodi auf
    void ListVideoModes(std::vector<VideoMode>& video_modes) const override;
    /// Funktion zum Setzen der Mauskoordinaten.
    void SetMousePos(int x, int y) override;
    /// Get state of the modifier keys
    KeyEvent GetModKeyState() const override;
    /// Gibt Pointer auf ein Fenster zurück (device-dependent!), HWND unter Windows
    void* GetMapPointer() const override;
private:
    bool SetVideoMode(const VideoMode& newSize, bool fullscreen);
    void PrintError(const std::string& msg);
    void HandlePaste();
   SDL_Surface* screen; /// Das Fenster-SDL-Surface.



I like the funny pictures ...
https://en.wikipedia.org/wiki/Mesa_(computer_graphics)

Editiert von Leuchtefix75 am 29.07.2018 19:44

Flamefire am 08.07.2018 01:31 #14986


I started working on that too. First step to support this would be using a newer OpenGL version and the Core profile. But we have to decide, what to support at the minimum. OpenGL 2.x is required for shaders, OpenGL 3.x to disallow glBegin & friends completely and have some more goodies.

See https://github.com/Return-To-The-Roots/s25client/pull/848

---
Github: https://github.com/Flamefire


Leuchtefix75 am 06.08.2018 14:26 #14998


https://www.raspberrypi.org/documentation/configuration/config-txt/

VC4 runs well with parameters
# cmdline.txt: cma=128M
config.txt:
hdmi_force_hotplug=1
gpu_mem=32 #16MB is the minimum but causes problems
avoid_warnings=2
dtoverlay=vc4-kms-v3d,cma-224
#dtoverlay=vc4-fkms-v3d,cma-128
...
and without xorg.conf
gpu_mem -native frame Buffer, no more used if KMS gets activated at boot
CMA -needed for kms driver, uses the MMU to transfer memory blocks by DMA
looks like a good idea to let some space of the first 256MB for CPU (memory-split / not GPU_MEM or CMA )
RAM issues can appear if 4/5 of RAM is used, because of memory fragmentation (google MMU REALLOC)

the RPI KMS driver is basiclly a MESA and so a openGL driver, Wayland uses MESA as backend
so there probably never be a /usr/lib/arm-linux-gnueabihf/dri/vc4_drv_video.so

Code:
lscpu
vcgencmd get_mem gpu
https://elinux.org/RPI_vcgencmd_usage
glxinfo
glxgears


glad/CMakeLists.txt
Code:
cmake_minimum_required(VERSION 3.1)
project(glad)

add_library(glad src/glad.c)
target_include_directories(glad PUBLIC include)

if(NOT WIN32)
  target_link_libraries(glad PUBLIC ${CMAKE_DL_LIBS})
endif()
https://github.com/Dav1dde/glad

build mesa your own
Code:

git clone git://anongit.freedesktop.org/mesa/mesa
cd mesa
./autogen.sh --prefix=$WLD
  --enable-gles2
  --with-egl-platforms=x11,wayland,drm
  --enable-gbm --enable-shared-glapi
  --with-gallium-drivers=vc4
  --without-dri-drivers
  --disable-va
  --disable-vdpau
  --disable-xvmc
  --disable-omx
make -j4 && make install

usually you got 2.4.74 and libdrm >= 2.4.75 is required

Code:
Mali DDK
----------------
|EGL,Base,GLES,VG|
----------------
        |
DDX    |
------------------               -----
| EXA, DRI2, FBDEV | <---------> | UMP |
------------------               -----
        ^
        |
        |
-----------------                -----
|   X.Org Server  | <----------> | DRM |
-----------------                -----


https://linux-sunxi.org/Mali400#Utgard

hint for crosscopiling:
The following are valid -mcpu values with --target=aarch64-arm-none-eabi:
cortex-a53
cortex-a57
The following are valid -mcpu values with --target=armv8a-arm-none-eabi:
cortex-a53
cortex-a57
The following are valid -mcpu values with --target=armv7a-arm-none-eabi:
cortex-a5
cortex-a7
cortex-a8
cortex-a9
cortex-a12
cortex-a15
cortex-a17

unknown type name 'Display'
/usr/include/EGL/eglplatform.h
Code:

#if defined(MESA_EGL_NO_X11_HEADERS)
typedef void            *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;

#else
/* X11 (tentative)  */
/* #include <X11/Xlib.h> */
/* #include <X11/Xutil.h> */
typedef Display *EGLNativeDisplayType;
typedef Pixmap   EGLNativePixmapType;
typedef Window   EGLNativeWindowType;


autoconf
autoreconf -i

Code:
int error = glGetError();
if (error != GL_NO_ERROR) {
  std::cout << "An OpenGL error has occured: " << gluErrorString(error) << std::endl;
}


"If you created any destroy many hundreds/thousands of lists many thousand times, the function may fail at some point, since there is a guarantee that all generated identifiers are contiguous. This is the same symptom as with heap fragmentation -- memory allocation can fail even though there is plenty of memory left."

https://www.reddit.com/r/C_Programming/comments/45wf43/getting_keyboard_input_on_linux/
https://www.microcontrollertips.com/using-input-devices-on-embedded-linux-usb-mouse-on-intel-edison/
https://tronche.com/gui/x/xlib/events/keyboard-pointer/keyboard-pointer.html
https://stackoverflow.com/questions/20943322/accessing-keys-from-linux-input-device


====some more half-wisdom====
ARMv7 is specifyed to have a MMU.

The GPU uses its MMU for memory copy.
The GPU can also access the CPU-RAM by it, even if it is an external graphic card.
The interesting point is to do no memory copy if both share the same RAM, zero-copy.
Therefore it has to be clear who of both "processors" allocates and free the buffer and how to avoid multiple access to it at the same time?
Another point is, if CPU and GPU(MMU) do different endianes, the memory address must be translated.
UMP handle these two points, so zero-copy is supported. But UMP is marked as deprecated, even if all MALI devices will still use it, also in future.
CMA might use the MMU. But it looks more like it only uses DMA.
However, there would be no need of a fixed graphic memory, if both processors can utilize the whole RAM and one memory driver for all.

In openGL you create or load something in client/userspace and let it copy by GL-command to GPU-API space, so no further processing by CPU would be possible.
And then you erase what you created.

If there is no fixed Framebuffer, means every application gets its own render buffer and the GPU filter it by layer-number/deep-buffer in realtime,
you don't move were an application window in the frame buffer is drawn, you move the place it is visible without the lag of drawing.
That is close to no work for the CPU.
If video playback has its own layer, you use two or more render buffer and zero-copy is enabled,
you just have to tell the GPU which one is visible for that layer, and meanwhile another one gets drawn/rendered.

WAYLAND is on that way.
But its X11 wrapper is very slow and most applications still depend on X11.

Editiert von Leuchtefix75 am 17.11.2019 02:19

~Gast am 22.01.2019 20:54 #15165


https://reddit.com/r/raspberry_pi/comments/ailmgj/raspberry_piopenclgpu_vc4cl_videocore_iv_opencl/

Just came here to link this interesting development regarding Raspberry Pi GPU. Don’t know if it really helps or not (GL vs.
CL?) but I really hope to be able to play this awesome game on Pi some day :)


Leuchtefix75 am 26.04.2019 14:03 #15223


Back To The Roots, Back To Reality!

it's an old... sourcecode
CMakeLists.txt
Code:
cmake_policy(SET CMP0057 OLD)
cmake_policy(SET CMP0010 OLD)

external/libsiedler2/CMakeLists.txt #if TEST is enabled
Code:
cmake_policy(SET CMP0012 OLD)


my OS is RASPBIAN(NOOBS3.0/ARMv7) on a RPi3
Code:
cmake_minimum_required(VERSION 3.7.2 ...
find_package(Boost 1.62.0 ...


GLAD is to provide an dedicated GL environment... old sourcecode, old GL
Code:
OGL...Compat


I don't care for crap of others!
cmake/Modules/ConstrainedOption.cmake
Code:
#  if(NOT "${${varName}}" IN_LIST ARG_VALUES)
#    message(FATAL_ERROR "Value of ${varName} is not any of ${ARG_VALUES}")
#  endif()


What is it for? For INTEL? I don't have, I don't care!
Code:
#target_compile_features(s25update PUBLIC cxx_std_14)


don't know why LUA is still an issue
cmake-qt-gui
Code:
LUA_LIB /usr/lib/arm-linux-gnueabihf/liblua5.2.a
LUA_INCLUDE_DIR /usr/include/lua5.2


/home/pi/s25client/CMakeLists.txt
Code:
if(${RTTR_VERSION} MATCHES "([0-9]+).([0-9]+).([0-9]+)")


and the lovely old message ... maybe, one day
Code:
‘std::move_iterator<Random<XorShift>::RandomEntry*>’ will change in GCC
7.1


GLES don't work. But we can
Code:
export RTTR_OGL_ES=ON

to use EGL

just to know...
Code:
void TerrainRenderer::Init(const MapExtent& size)
{
    printf("GL_VERSION  : %sn", glGetString(GL_VERSION) );
    printf("GL_RENDERER : %sn", glGetString(GL_RENDERER) );



maps over 100 still crashes by memory issues
lower maps work, but slightly unstable and at that risk
setting mfpu=neon to make higher maps start
Code:
#/home/pi/s25client/cmake/Modules/ArmConfig.cmake
    elseif(target STREQUAL "RasPi2")
      macro(get_arm_fpu result target)
        set(${result} neon)

but memory access issue appear on quit after all on quit? who cares
...
Upgrade to Raspbian Buster: no UNALIGNED_ACCESS, no error? or the new compiler?... all maps playable and stable now


...some hackage
Code:
#./external/s-c/resample-1.8.1/sndlib-20/headers.c
if(cksizer < (off_t)HDRBUFSIZ) //to avoid the typ-mismatch warning uint/int

#./cmake/optimizations.cmake
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
  include(AddFlags)
  add_flags(CMAKE_C_FLAGS -fopenmp)  #looks like resample makes use of it? the sound part is in C
  add_flags(CMAKE_CXX_FLAGS -pthread) #looks like some loader/log routines makes use of it, but not the core game?

#./external/libsiedler2/include/libsiedler2/ColorARGB.h
#ifdef RTTR_USE_UNALIGNED_ACCESS  //to avoid the... stupid warning in case RTTR_USE_UNALIGNED_ACCESS is not defined


Trace/Breakpoint (Received a SIGTRAP)
=> RTTR_Assert_Enabled = 0

Editiert von Leuchtefix75 am 03.12.2019 15:01

Leuchtefix75 am 01.05.2019 23:12 #15226


...you need something to get something more!

http://www.codesourcery.com
ulimit -s 32768

http://linuxfromscratch.org/lfs/view/development/chapter06/gcc.html
Code:
SED=sed                              
../configure --prefix=/usr            
             --enable-languages=c,c++
             --disable-multilib      
             --disable-bootstrap      
             --with-system-zlib

dpkg-buildpackage -G -us -ui -uc

https://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/
Code:
$ cd gcc-4.9.2
$ ln -s ../mpfr-3.1.2 mpfr
$ ln -s ../gmp-6.0.0 gmp
$ ln -s ../mpc-1.0.2 mpc
$ ln -s ../isl-0.12.2 isl
$ ln -s ../cloog-0.18.1 cloog
$ cd ..

dont want to maintain a thing, just want to have, but...
https://www.debian.org/doc/manuals/maint-guide/
or short version
https://ubuntuforums.org/showthread.php?t=910717

https://developer.arm.com/tools-and-software/open-source-software/developer-
tools/gnu-
toolchain/gnu-a/downloads


https://www.boost.org/users/download/

https://cmake.org/download/

https://solarianprogrammer.com/2017/12/08/raspberry-pi-raspbian-install-gcc-compile-
cpp-17-
programs/

https://blog.packagecloud.io/eng/2015/07/14/using-dh-make-to-prepare-debian-packages/
=====
wget http://ftp.snt.utwente.nl/pub/software/gnu/binutils/binutils-2.29.tar.xz                                                              
wget ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz                                                            
wget http://ftp.gnu.org/gnu/glibc/glibc-2.26.tar.xz                  
tar xvf binutils-2.29.tar.xz      
tar xvf gcc-7.2.0.tar.xz          
cd binutils-2.29                  
./configure --target=armv7l-unknown-linux-gnueabihf --disable-multilib
make                          
sudo make install                  
cd ..                              
scp drone:headers.tar.gz .        
cd /usr/local/armv7l-unknown-linux-gnueabihf                          
sudo tar xzvf $OLDPWD/headers.tar.gz                                  
cd -                              
cd gcc-7.2.0                      
./contrib/download_prerequisites  
mkd ../gcc-build                  
../gcc-7.2.0/configure --enable-languages=c,c++,lto --enable-shared --enable-
threads=posix --
with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --
enable-
clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --
enable-linker-
build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-
style=gnu --
enable-gnu-indirect-function --disable-multilib --disable-werror --enable-
checking=release --
target=armv7l-unknown-linux-gnueabihf --with-arch=armv7-a --with-float=hard --with-
fpu=vfpv3-d16                              
make all-gcc                  
sudo make install-gcc              
cd ..                              
tar xvf glibc-2.26.tar.xz          
mkd glibc-build                    
../glibc-2.26/configure --prefix=/usr/local/armv7l-unknown-linux-gnueabihf --
build=$MACHTYPE --
host=armv7l-unknown-linux-gnueabihf --target=armv7l-unknown-linux-gnueabihf --with-
headers=/usr/local/armv7l-unknown-linux-gnueabihf/include --disable-multilib
libc_cv_forced_unwind=yes
make # This fails, but it does succeed buildling the parts we need now.                                                                
sudo make install-bootstrap-headers=yes install-headers                                                                                    
sudo install csu/crt1.o csu/crti.o csu/crtn.o /usr/local/armv7l-unknown-linux-
gnueabihf/lib/                                                
sudo touch /usr/local/armv7l-unknown-linux-gnueabihf/include/gnu/stubs.h                                                                    
sudo /usr/local/bin/armv7l-unknown-linux-gnueabihf-gcc -nostdlib -nostartfiles -
shared -x c
/dev/null -o /usr/local/armv7l-unknown-linux-gnueabihf/lib/libc.so                                                                                                                          
cd ../gcc-build                                                                                                                            
make all-target-libgcc                                                                                                                  
sudo make install-target-libgcc                                                                                                            
cd ../glibc-build                                                                                                                          
make                                                                                                                                    
sudo make install                                                                                                                          
cd ../gcc-build                                                                                                                            
make                                                                                                                                    
sudo make install
====

SDL2 + DRM needs LIBGDM-dev!

new strategy: build a toolchain, build boost, build cmake, build game
I would prefer to do the last!

if fail...
make distclean

DEB Debian packaging
build-essential
devscripts
debhelper

export LD_LIBRARY_PATH="$LOCAL/lib"
export PKG_CONFIG_PATH="$LOCAL/lib/pkgconfig:$LOCAL/share/pkgconfig"
export CFLAGS="-I/usr/include/arm-linux-gnueabihf"     # for the C compiler
export CXXFLAGS="-I/usr/include/arm-linux-gnueabihf/sys"   # for the C++ compiler
export LDFLAGS="-L$LOCAL/lib"        # for the linker

I have no idea, but it sounds like something to care for
Code:
System calls that are interrupted by signals can either abort and return EINTR
or
automatically restart themselves if and only if SA_RESTART is specified in
sigaction(2)
...
and the one responsible for this task is the restart_block which used to track
information and
arguments for restarting system calls


dEQP failures on llvmpipe
GALLIVM_DEBUG=no_rho_approx,no_bilinear,no_quad_lod

VALKYRIE(GUI for Valgrind)
VALGRIND utilize MEMCHECK and mockup MALLOC by vg_replace_malloc.c to produce a more
detailed
output
And keep in mind: MALLOC don't produce the ERROR, it detects it!

Doubly/double linked list example
Code:
struct symbol *next_sym = NULL;

for(sym = st[i]; sym != NULL; ) {
    next_sym = sym->next;
    free(sym);
    sym = next_sym;
}


just to have fun
https://forum.unity.com/threads/why-wasnt-timeline-named-compositor.536102/

https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit
RPI3b(bcm2835) has 2 MMU's(Memory Management Unit - block/frame wise RAM access by DMA)
...MMU for CPU<=>RAM
...SMMU(IOMMU) for IO<=>RAM

activating the GL(Full KMS) by raspi-config allocates 256MB CMA(Contiguous memory allocation)
CMA is designed for system without MMU, so reallocation may be not possible

I wonder what's the differnce of the deprecated UMP(Universal Memory Provider) which is still needed for MALI drivers on Banana PI?
export CFLAGS="-mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits"
--with-arch=armv6 --with-fpu=vfp --with-float=hard

https://www.andreasch.com/2018/05/08/rpi3-kernel-aarch64/
Code:
s25client: malloc.c:2883: mremap_chunk: Assertion `((size + offset) & (GLRO
(dl_pagesize) - 1)) == 0' failed.

realloc(): invalid old size

Trace/Breakpoint ausgelöst

...the signed/unsigned issue ?...
In file included from /home/pi/s25clientl/s-c/resample-1.8.1/sndlib-20/sound.c:36:
/home/pi/s25clientl/s-c/resample-1.8.1/sndlib-20/sound.c: In function
‘mus_sound_set_maxamps’:
/home/pi/s25clientl/s-c/resample-1.8.1/sndlib-20/_sndlib.h:399:22: error: argument 1
value ‘4294967295’ exceeds
maximum object size 2147483647 [-Werror=alloc-size-larger-than=]
#define CALLOC(a, b) calloc((size_t)(a), (size_t)(b))

#s-c/resample-1.8.1/sndlib-20/headers.c
  static int read_avi_header(const char* filename, int chan)
    if(cksizer < (off_t)HDRBUFSIZ)



Code:
from /home/pi/s25client/external/libutil/src/FileWriter.cpp:18:
/usr/include/c++/8/ext/concurrence.h:122:34: error: too many initializers for
‘__pthread_mutex_s’
__gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
                                  ^~~~~~~~~~~~~~~~~~~~

It is illegal to have an array of unknown bound as a non-static member of a struct.
[class.mem]/13
Non-static data members shall not have incomplete types.
This is because the size of the class must be known when the closing brace is
reached.
Maybe you should make stateDuration a std::vector<unsigned int> instead.

...compiling RPI3 + GLES2.0...
/home/pi/s25client/external/libsiedler2/include/libsiedler2/ColorARGB.h:107:5: error:
"RTTR_USE_UNALIGNED_ACCESS" is
not defined, evaluates to 0 [-Werror=undef]
#if RTTR_USE_UNALIGNED_ACCESS

/home/pi/s25client/external/s-c/resample-1.8.1/sndlib-20/headers.c:2175:44: error:
comparison of integer expressions
of different signedness: ‘off_t’ {aka ‘long int’} and ‘unsigned int’ [-Werror=sign-
compare]
                                 if(cksizer < HDRBUFSIZ)



"Vomiting is not Projectile" bug

Editiert von Leuchtefix75 am 01.07.2019 21:53

Leuchtefix75 am 17.05.2019 13:04 #15243


I did it... no, I don't... but was so close!

stdarg.h file not found ?
=======================

prerequirements:
libmpc-dev bison
-


1)download the source
wget XYZ-1.2.tar.xz

2)unpack it
tar xvf XYZ-1.2.tar.xz

3)step into the subfolder
cd XYZ_1.2

dh_make -f ../XYZ-1.2.tar.xz =>i=>Y=>y

4) do a subfolder in there
mkdir debian

5) some simple text only files into this subfolter
dch -i --create

changelog
compat
control
copyright
rules

6) do or change some entries (if you offer you work to others, you should be
serious)
#changelog
XYZ (1.2.3) unstable; urgency=medium

  * Initial release.

#compat => debhelper-Kompatibilitätsstufe
9

#control
Source: XYZ  
Maintainer: pi <pi@raspberrypi>
Build-Depends:
Standards-Version: 1.2.3
Section: utils

Package: XYZ  
Priority: extra  
Architecture: any
Depends:  
Description: XYZ 1.2.3
Just prints "Hi", it's very useful.

#copyright
Copyright 2019, GNU GENERAL PUBLIC LICENSE

#rules
#!/usr/bin/make -f  
%:  
    dh $@

7) from the source path build this pice of deb
debuild -us -uc

8) step out the souce folder, and there it should be, ready to install to your
system
XYZ-1.2.3_armhf.deb
XYZ-dbgsym_1.2.3_armhf.deb

==========================

cat >>~/.bashrc <<EOF
DEBEMAIL="person@company.tld"
DEBFULLNAME="Testy McTester"
export DEBEMAIL DEBFULLNAME
EOF
. ~/.bashrc

==========================
# http://www.linuxfromscratch.org/blfs/view/cvs/general/gcc.html
#Recommended:  Tcl, Expect and DejaGnu
wget https://ftpmirror.gnu.org/gcc/gcc-9.1.0/gcc-9.1.0.tar.gz
tar xf gcc-9.1.0.tar.gz
cd gcc-9.1.0
contrib/download_prerequisites

auto-apt run ./configure DFLAGS="-O3 -march=native""
make
sudo checkinstall
...or...
dpkg-buildpackage -b
--------------------------
sudo apt-get install --reinstall build-essential
sudo apt-get install --reinstall gcc
sudo dpkg-reconfigure build-essential
sudo dpkg-reconfigure gcc

==========================
git clone https://github.com/giuliomoro/checkinstall
cd checkinstall
make install
==========================
#https://cmake.org/download/
#download the sourcecode file
tar xvf cmake-3.14.4.tar.gz
cd cmake-3.14.4
mkdir cmake-3.14.4
cd cmake-3.14.4
auto-apt run ../bootstrap   --qt-gui #depends on qtbase5-dev
make
sudo checkinstall
# install the *.DEB from filemanager or package-manager
cmd# cmake-gui

Editiert von Leuchtefix75 am 01.06.2019 11:55

Leuchtefix75 am 18.06.2019 21:16 #15248


I did it by Raspbian/buster.
It was still marked as unstable... but as stable now
And as usual, a distribution upgrade can break some serious parts. Backup before!

SYNAPTIC is still a nice tool for DEBIAN package management
If using SYNAPTIC for the first time, you should disable
Code:
=> Preferences/Einstellungen => Paketmanagement => Empfohlene Pakete als Abhängigkeiten ansehen

Code:
=> Preferences/Einstellungen => Paketmanagement => Distribution => replace jessie by buster
=> close synaptic
https://phoenixnap.com/kb/how-to-upgrade-debian-9-stretch-to-debian-10-buster
Code:
sudo leafpad /etc/apt/sources.list
sudo leafpad /etc/apt/sources.list.d/raspi.list

...package source is selected, prepare your system...
Code:
sudo apt update
sudo raspi-config => update
sudo rpi-update

Now you can update packages as you need, one by one (LIBC6 is the best first step)
or upgrade the whole installation
Code:
sudo apt clean
sudo apt autoremove
sudo apt upgrade

However, now you can install/upgrade the build tools needed for actual S25.

#Der Download wird als root und nicht Sandbox-geschützt durchgeführt
sudo rm -f /var/cache/apt/archives/partial/*
sudo chown _apt:root /var/cache/apt/archives/partial/

Zurückgehaltene Pakete - broken packages
Code:
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists/*
sudo rm /var/cache/apt/*.bin
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update
sudo dpkg --configure -a
sudo apt-get install -f

if still getting same error then try
Code:
sudo dpkg --remove --force-remove-reinstreq <package_name>

after removing package update your system and restart once.

Note:
firefox60+ -Video streaming is broken
so...
Code:
media.ffmpeg.enabled;false  #maybe stream buffer issue, how to use MPV/mplayer
media.gmp.decoder.enabled;true #or use gecko media player, Mozilla fork of GNU media-player
...and FALSE all REPORT in about:config ...about:about maybe also very helpfull
...and resistFingerprinting


or use an older Version!
you can copy the .DEB file to /var/cache/apt/archives and then install it from your package-manager
Code:
sudo apt-get purge firefox
wget http://launchpadlibrarian.net/352602073/firefox_57.0.4+build1-0ubuntu0.14.04.1_armhf.deb
sudo dpkg -i firefox_57.0.4+build1-0ubuntu0.14.04.1_armhf.deb
echo 'user_pref("gfx.content.azure.backends", "");' >> ~/.mozilla/firefox/*.default/prefs.js

...but this version needs pulseaudio!
firefox dependencies are all close to a must-be
sudo apt-cache depends firefox-esr
...
https://packages.debian.org/sid/armhf/firefox

pulseaudio -serious issues with ALSA backend -looks like a political issue, like both want to get, what the other already is
-the audio device you want to use in Pulseaudio must not be selected as default in the PI-mixer(ALSA)

Editiert von Leuchtefix75 am 08.11.2019 14:22

Leuchtefix75 am 26.06.2019 11:25 #15250


compiling with GLES2.0 -> undefined reference to:

Code:
glad_glEnableClientState => glEnable
glad_glDisableClientState => glDisable

glad_glBegin
glad_glEnd
=>glVertexPointer; glDrawArrays => ?


glad_glColor3f
glad_glColor3ub
glad_glColor4ub
=> no equation => how about a texture of one dot? or is there a limit
...and stretch it to size  

glad_glVertex2i
glad_glVertexPointer => glVertexAttribPointer
glad_glTexCoordPointer
glad_glColorPointer

glad_glTexEnvf
glad_glTexEnvi
glad_glPopMatrix
glad_glMatrixMode
glad_glTranslatef
glad_glPushMatrix
glad_glScalef

glad_glLoadIdentity => glMatrixLoadIdentityEXT => ?
glad_glOrtho        => glMatrixOrthoEXT => ?
glad_glShadeModel   => no fixed shader in GLES2.0, so glCreate it => ?
glad_glAlphaFunc    => glAlphaFuncQCOM


OES is the "vendor"-code for the OpenGL ES working group
ARB -code for desktop-OpenGL

The basic idea is:
-you define an array in CPU-RAM, give the graphix API the poiter(start address of the
array) and the size of the array
-the API/GPU read it by DMA into GPU-RAM and use it as described
-the target should be to avoid to much of this copy action and reuse what the GPU-RAM
already has... but to poiter this out is exctly the problem


Note: generating GLAD use GLES2.0 version 3.1 (GLES3/GL31.h)
but at all GLES2.0 has no fixed shader, so your program provides the source code for a shader and a texture compiler,
which are compiled and uploaded to GPU at runtime.
It's close to SIMD, if it not already share the same registers.

Editiert von Leuchtefix75 am 02.08.2019 23:26

Leuchtefix75 am 23.07.2019 22:41 #15264


Code:
// example of Open Multi-Processing
// if Function is used instead of Void see: Open MPI is a Message Passing Interface
// to compile: g++ -fopenmp omp_example.cpp

#include <omp.h>
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int i;
    omp_set_num_threads(4);

    #pragma omp parallel for
    for (i = 0; i < 4; ++i)
    {
        const int id = omp_get_thread_num();

        printf("Hello World from thread %dn", id);

        if (id == 0)
            /* only run in master thread */
            printf("There are %d threadsn", omp_get_num_threads());
    }

    return EXIT_SUCCESS;
}


still looking for a good example of std::thread or boost::thread


Spatial Tutorial - General Matrix Multiply (GeMM) like SIMD(MMX/SSE/NEON)/openCL/GLM
https://champyen.blogspot.com/2018/12/spatial-tutorial-general-matrix.html

https://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations

Editiert von Leuchtefix75 am 22.01.2020 16:33



Feel free to post in English!

Antwort schreiben

Username:
Security code:
Text:

   
  Convert smilies like :), ;) etc. into small graphics?
  Convert WWW-addresses into clickable links?
  Soll Boardcode in ihrer Nachricht aktiviert werden?