FGPanel: update for Raspbian 10
This commit is contained in:
parent
1ce36af298
commit
d0fd02fa8d
5 changed files with 88 additions and 50 deletions
|
@ -1,6 +1,14 @@
|
||||||
find_package(PNG REQUIRED)
|
find_package(PNG)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL)
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype)
|
||||||
|
|
||||||
|
if((NOT PNG_FOUND) OR (NOT OPENGL_FOUND) OR (NOT FREETYPE_FOUND))
|
||||||
|
message(WARNING "FGPanel enabled, but some dependencies are missing")
|
||||||
|
message(STATUS "libPNG: ${PNG_FOUND}")
|
||||||
|
message(STATUS "OpenGL: ${OPENGL_FOUND}")
|
||||||
|
message(STATUS "Freetype: ${FREETYPE_FOUND}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
find_path(BCMHOST_INCLUDE_DIR
|
find_path(BCMHOST_INCLUDE_DIR
|
||||||
NAMES bcm_host.h
|
NAMES bcm_host.h
|
||||||
|
@ -13,15 +21,7 @@ include_directories(
|
||||||
${PNG_INCLUDE_DIR}
|
${PNG_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BCMHOST_INCLUDE_DIR)
|
set(TARGET_SOURCES
|
||||||
# CMAKE > 3.1 : target_sources(fgpanel
|
|
||||||
set(TARGET_SOURCES
|
|
||||||
GLES_utils.cxx
|
|
||||||
GLES_utils.hxx
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_executable(fgpanel
|
|
||||||
main.cxx
|
main.cxx
|
||||||
ApplicationProperties.hxx
|
ApplicationProperties.hxx
|
||||||
ApplicationProperties.cxx
|
ApplicationProperties.cxx
|
||||||
|
@ -63,58 +63,82 @@ add_executable(fgpanel
|
||||||
panel_io.hxx
|
panel_io.hxx
|
||||||
GL_utils.cxx
|
GL_utils.cxx
|
||||||
GL_utils.hxx
|
GL_utils.hxx
|
||||||
${TARGET_SOURCES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_executable(fgpanel ${TARGET_SOURCES})
|
||||||
|
|
||||||
target_link_libraries(fgpanel
|
target_link_libraries(fgpanel
|
||||||
${PNG_LIBRARIES}
|
|
||||||
SimGearCore
|
SimGearCore
|
||||||
|
${PNG_LIBRARIES}
|
||||||
${FREETYPE_LIBRARIES}
|
${FREETYPE_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(BCMHOST_INCLUDE_DIR)
|
if(BCMHOST_INCLUDE_DIR)
|
||||||
message(STATUS "found Raspberry Pi")
|
message(STATUS "found Raspberry Pi")
|
||||||
|
|
||||||
include_directories(
|
add_executable(fgpanel-egl ${TARGET_SOURCES}
|
||||||
|
GLES_utils.cxx
|
||||||
|
GLES_utils.hxx
|
||||||
|
)
|
||||||
|
target_include_directories(fgpanel-egl PUBLIC
|
||||||
${BCMHOST_INCLUDE_DIR}
|
${BCMHOST_INCLUDE_DIR}
|
||||||
${BCMHOST_INCLUDE_DIR}/interface/vcos/pthreads
|
${BCMHOST_INCLUDE_DIR}/interface/vcos/pthreads
|
||||||
${BCMHOST_INCLUDE_DIR}/interface/vmcs_host/linux
|
${BCMHOST_INCLUDE_DIR}/interface/vmcs_host/linux
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(fgpanel
|
target_link_libraries(fgpanel-egl
|
||||||
-lGLESv2 -lEGL -lm -lbcm_host -L/opt/vc/lib
|
SimGearCore
|
||||||
|
${PNG_LIBRARIES}
|
||||||
|
${FREETYPE_LIBRARIES}
|
||||||
|
-lbrcmGLESv2 -lbrcmEGL -lm -lbcm_host -L/opt/vc/lib
|
||||||
)
|
)
|
||||||
|
|
||||||
add_definitions(-D_GLES2 -D_RPI)
|
target_compile_definitions(fgpanel-egl PUBLIC
|
||||||
else()
|
-D_GLES2 -D_RPI
|
||||||
find_package(GLUT)
|
)
|
||||||
if(GLUT_FOUND)
|
target_compile_definitions(fgpanel PUBLIC
|
||||||
|
-D_RPI
|
||||||
|
)
|
||||||
|
message(STATUS "FGPanel (Raspberry Pi) : ENABLED")
|
||||||
|
install(TARGETS fgpanel-egl RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
else(BCMHOST_INCLUDE_DIR)
|
||||||
|
message(STATUS "FGPanel (Raspberry Pi) : DISABLED")
|
||||||
|
endif(BCMHOST_INCLUDE_DIR)
|
||||||
|
|
||||||
find_package(GLEW)
|
find_package(GLUT)
|
||||||
if(GLEW_FOUND)
|
if(GLUT_FOUND)
|
||||||
|
message(STATUS "found GLUT inc ${GLUT_INCLUDE_DIR}, lib ${GLUT_LIBRARIES}")
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_definitions(fgpanel PUBLIC
|
||||||
|
-DFREEGLUT_LIB_PRAGMAS=0
|
||||||
|
)
|
||||||
|
endif(MSVC)
|
||||||
|
|
||||||
include_directories(
|
find_package(GLEW)
|
||||||
${GLEW_INCLUDE_DIRS}
|
if(GLEW_FOUND)
|
||||||
)
|
message(STATUS "found GLEW inc ${GLEW_INCLUDE_DIR}, lib ${GLEW_LIBRARIES}")
|
||||||
|
|
||||||
target_link_libraries(fgpanel
|
target_include_directories(fgpanel PUBLIC
|
||||||
${GLUT_LIBRARIES}
|
${GLEW_INCLUDE_DIRS}
|
||||||
${GLEW_LIBRARIES}
|
)
|
||||||
${OPENGL_LIBRARIES}
|
|
||||||
)
|
target_link_libraries(fgpanel
|
||||||
else(GLEW_FOUND)
|
${OPENGL_LIBRARIES}
|
||||||
message(WARNING "GLEW NOT found, can't build FGPanel")
|
${GLUT_LIBRARIES}
|
||||||
set(WITH_FGPANEL 0)
|
${GLEW_LIBRARIES}
|
||||||
endif(GLEW_FOUND)
|
)
|
||||||
else(GLUT_FOUND)
|
else(GLEW_FOUND)
|
||||||
message(WARNING "GLUT NOT found, can't build FGPanel")
|
message(WARNING "GLEW NOT found, can't build FGPanel")
|
||||||
set(WITH_FGPANEL 0)
|
set(WITH_FGPANEL 0)
|
||||||
endif(GLUT_FOUND)
|
endif(GLEW_FOUND)
|
||||||
endif()
|
else(GLUT_FOUND)
|
||||||
|
message(WARNING "GLUT NOT found, can't build FGPanel")
|
||||||
|
set(WITH_FGPANEL 0)
|
||||||
|
endif(GLUT_FOUND)
|
||||||
|
|
||||||
if(WITH_FGPANEL)
|
if(WITH_FGPANEL)
|
||||||
message(STATUS "FGPanel : ENABLED")
|
message(STATUS "FGPanel : ENABLED")
|
||||||
install(TARGETS fgpanel RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS fgpanel RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
else()
|
else(WITH_FGPANEL)
|
||||||
message(WARNING "FGPanel : DISABLED")
|
message(WARNING "FGPanel : DISABLED")
|
||||||
endif()
|
endif(WITH_FGPANEL)
|
||||||
|
|
|
@ -89,7 +89,8 @@ void
|
||||||
FGPanel::init () {
|
FGPanel::init () {
|
||||||
// Textured Layer Shaders
|
// Textured Layer Shaders
|
||||||
const char V_Textured_Layer_Shader_Str[] =
|
const char V_Textured_Layer_Shader_Str[] =
|
||||||
#ifdef _GLES2
|
#ifdef _RPI
|
||||||
|
"#version 100 \n"
|
||||||
"attribute vec4 a_position; \n"
|
"attribute vec4 a_position; \n"
|
||||||
"attribute vec2 a_tex_coord; \n"
|
"attribute vec2 a_tex_coord; \n"
|
||||||
"varying vec2 v_tex_coord; \n"
|
"varying vec2 v_tex_coord; \n"
|
||||||
|
@ -106,7 +107,8 @@ FGPanel::init () {
|
||||||
"} \n";
|
"} \n";
|
||||||
|
|
||||||
const char F_Textured_Layer_Shader_Str[] =
|
const char F_Textured_Layer_Shader_Str[] =
|
||||||
#ifdef _GLES2
|
#ifdef _RPI
|
||||||
|
"#version 100 \n"
|
||||||
"precision mediump float; \n"
|
"precision mediump float; \n"
|
||||||
"varying vec2 v_tex_coord; \n"
|
"varying vec2 v_tex_coord; \n"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include <GLUT/glut.h>
|
#include <GLUT/glut.h>
|
||||||
#elif defined (_GLES2)
|
#elif defined (_GLES2)
|
||||||
#include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
#include "GLES_utils.hxx"
|
|
||||||
#else
|
#else
|
||||||
#include <GL/glew.h> // Must be included before <GL/gl.h>
|
#include <GL/glew.h> // Must be included before <GL/gl.h>
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
|
|
@ -35,7 +35,8 @@ GLint FGTextLayer::Text_Layer_Color_Loc (0);
|
||||||
bool
|
bool
|
||||||
FGTextLayer::Init () {
|
FGTextLayer::Init () {
|
||||||
const char V_Text_Layer_Shader_Str[] =
|
const char V_Text_Layer_Shader_Str[] =
|
||||||
#ifdef _GLES2
|
#ifdef _RPI
|
||||||
|
"#version 100 \n"
|
||||||
"attribute vec4 a_position; \n"
|
"attribute vec4 a_position; \n"
|
||||||
"attribute vec2 a_tex_coord; \n"
|
"attribute vec2 a_tex_coord; \n"
|
||||||
"varying vec2 v_tex_coord; \n"
|
"varying vec2 v_tex_coord; \n"
|
||||||
|
@ -52,7 +53,8 @@ FGTextLayer::Init () {
|
||||||
"} \n";
|
"} \n";
|
||||||
|
|
||||||
const char F_Text_Layer_Shader_Str[] =
|
const char F_Text_Layer_Shader_Str[] =
|
||||||
#ifdef _GLES2
|
#ifdef _RPI
|
||||||
|
"#version 100 \n"
|
||||||
"precision mediump float; \n"
|
"precision mediump float; \n"
|
||||||
"varying vec2 v_tex_coord; \n"
|
"varying vec2 v_tex_coord; \n"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -15,10 +15,10 @@ INSTALLATION
|
||||||
The source code of FGPanel can easily be adapted to other embedded devices supporting OpenGL ES 2.0.
|
The source code of FGPanel can easily be adapted to other embedded devices supporting OpenGL ES 2.0.
|
||||||
|
|
||||||
3. Build FGPanel only (don't build all components on the Raspberry Pi as this will take ages!!!):
|
3. Build FGPanel only (don't build all components on the Raspberry Pi as this will take ages!!!):
|
||||||
make -- fgpanel
|
make -- fgpanel-egl fgpanel
|
||||||
|
|
||||||
USAGE
|
USAGE (fgpanel-egl)
|
||||||
=====
|
===================
|
||||||
|
|
||||||
1. Increase the amount of GPU memory by editing the /boot/config.txt file.
|
1. Increase the amount of GPU memory by editing the /boot/config.txt file.
|
||||||
Add the following line (this is for Raspberry Pi model 1B with 512 Mb of memory):
|
Add the following line (this is for Raspberry Pi model 1B with 512 Mb of memory):
|
||||||
|
@ -30,10 +30,21 @@ USAGE
|
||||||
3. Stop X server. FGPanel runs in the console (Linux framebuffer).
|
3. Stop X server. FGPanel runs in the console (Linux framebuffer).
|
||||||
|
|
||||||
4. Start FGPanel as usual but as ROOT or use the 'sudo' command (see README):
|
4. Start FGPanel as usual but as ROOT or use the 'sudo' command (see README):
|
||||||
sudo -- utils/fgpanel/fgpanel --fg-root=/path/to/fg/data --panel=Aircraft/MyAircraft/Panels/MyPanel.xml
|
sudo -- utils/fgpanel/fgpanel-egl --fg-root=/path/to/fg/data --panel=Aircraft/MyAircraft/Panels/MyPanel.xml
|
||||||
|
|
||||||
ROOT privileges are required to access the GPU of the Raspberry Pi.
|
ROOT privileges are required to access the GPU of the Raspberry Pi.
|
||||||
|
|
||||||
|
USAGE (fgpanel)
|
||||||
|
===================
|
||||||
|
|
||||||
|
1. Activate the Full KMS driver on the Raspberry Pi using the raspi-config program:
|
||||||
|
Advanced Options -> GL Driver -> Full KMS
|
||||||
|
|
||||||
|
2. Reboot. The Full KMS driver should be activated.
|
||||||
|
|
||||||
|
3. When X server is running, start FGPanel as usual (see README):
|
||||||
|
utils/fgpanel/fgpanel --fg-root=/path/to/fg/data --panel=Aircraft/MyAircraft/Panels/MyPanel.xml
|
||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
========
|
========
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue