-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
462 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Project default | ||
option(GL_MODULES "GL_MODULES" ON) | ||
|
||
# Xorg | ||
if(GL_MODULES) | ||
# OpenGL/GLEW | ||
find_library(GLEW glew32) | ||
pkg_check_modules(GLEW QUIET glew) | ||
if(GLEW OR GLEW_FOUND) | ||
add_library(gl_stars SHARED "${XAVA_MODULE_DIR}/main.c" | ||
"${XAVA_MODULE_DIR}/../../util/shader.c" | ||
"${XAVA_MODULE_DIR}/../../util/misc.c" | ||
"${GLOBAL_FUNCTION_SOURCES}") | ||
target_link_directories(gl_stars PRIVATE | ||
"${GLEW_LIBRARY_DIRS}") | ||
target_include_directories(gl_stars PRIVATE | ||
"${GLEW_INCLUDE_DIRS}") | ||
|
||
if(WINDOWS OR MINGW OR MSVC OR CYGWIN) | ||
target_link_libraries(gl_stars xava-shared "-lglew32 -lopengl32") | ||
else() | ||
target_link_libraries(gl_stars xava-shared "${GLEW_LIBRARIES}") | ||
endif() | ||
target_compile_definitions(gl_stars PUBLIC -DGL) | ||
|
||
set_target_properties(gl_stars PROPERTIES PREFIX "") | ||
set_target_properties(gl_stars PROPERTIES IMPORT_PREFIX "") | ||
set_target_properties(gl_stars PROPERTIES OUTPUT_NAME "gl/module/stars/module") | ||
|
||
# this copies the dlls for mr. windows | ||
#find_and_copy_dlls(gl_stars) | ||
|
||
configure_file("${XAVA_MODULE_DIR}/vertex.glsl" gl/module/stars/vertex.glsl COPYONLY) | ||
configure_file("${XAVA_MODULE_DIR}/fragment.glsl" gl/module/stars/fragment.glsl COPYONLY) | ||
configure_file("${XAVA_MODULE_DIR}/config.ini" gl/module/stars/config.ini COPYONLY) | ||
|
||
install(TARGETS gl_stars RENAME module DESTINATION share/xava/gl/module/stars/) | ||
install(FILES "${CMAKE_BINARY_DIR}/gl/module/stars/vertex.glsl" RENAME vertex.glsl.example DESTINATION share/xava/gl/module/stars/) | ||
install(FILES "${CMAKE_BINARY_DIR}/gl/module/stars/fragment.glsl" RENAME fragment.glsl.example DESTINATION share/xava/gl/module/stars/) | ||
install(FILES "${CMAKE_BINARY_DIR}/gl/module/stars/config.ini" RENAME config.ini.example DESTINATION share/xava/gl/module/stars/) | ||
|
||
# Maybe GL license? | ||
else() | ||
message(WARNING "GLEW library not found; \"gl_stars\" won't build") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Config options related to the "stars" gl module | ||
# Remove ';' for the config options to apply | ||
|
||
[stars] | ||
|
||
# Change star color in AARRGGB hex fashion | ||
; color = "#ffffffff" | ||
|
||
# Set a specific number of stars. If enabled, "density" will stop working. | ||
; count = 100 | ||
|
||
# Control density of stars on the screen. Calculates the number of stars | ||
# relative to screen resolution and this is just a simple scalar to that | ||
# WARNING: Setting this value too high may cause graphical glitches due | ||
# to Cairo draw limits | ||
; density = 1.0 | ||
|
||
# Set maximum star size (in pixels) | ||
; max_size = 5 | ||
|
||
# Enable/disable depth test for the stars. | ||
# This is used for cases where the depth buffer is undesired for the stars, such | ||
# as when using the shadow post shader. | ||
; depth_test = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#version 420 core | ||
|
||
// color passed from the host | ||
uniform vec4 foreground_color; | ||
|
||
// color passed from the host | ||
uniform vec4 background_color; | ||
|
||
// screen width and height | ||
uniform vec2 resolution; | ||
|
||
uniform float intensity; | ||
|
||
layout(location=0) out vec4 FragColor; | ||
|
||
void main() { | ||
FragColor = foreground_color; | ||
} | ||
|
Oops, something went wrong.