Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
e1c49c4
Update Android.mk
Duron27 Mar 6, 2024
dfa8987
use cmake
Duron27 Apr 19, 2024
48d21ff
dxt from sisah
Duron27 Apr 19, 2024
be8d47f
Delete Android.mk.orig
Duron27 Apr 19, 2024
3e67eab
Update Android.mk
Duron27 Apr 19, 2024
9845b3b
Update Android.mk
Duron27 Apr 19, 2024
f3960f8
Update CMakeLists.txt
Duron27 Apr 23, 2024
7a07284
Update CMakeLists.txt
Duron27 Apr 23, 2024
d452f06
Update CMakeLists.txt
Duron27 Apr 23, 2024
586dc48
Update CMakeLists.txt
Duron27 Apr 23, 2024
6f7b497
upgrade to sisah
Duron27 Apr 30, 2024
f89eb09
Update Android.mk
Duron27 Jun 30, 2024
dd57cc8
Update Android.mk
Duron27 Jun 30, 2024
29a129a
testing GLES 3
Duron27 Jul 1, 2024
a5d4c9e
Merge branch 'ptitSeb:master' into master
Duron27 Jul 1, 2024
a2c80d1
remove -thin
Duron27 Jul 1, 2024
e712513
reset
Duron27 Jul 1, 2024
65817cb
reset
Duron27 Jul 2, 2024
21dfd3d
Merge branch 'master' of https://github.com/Duron27/gl4es
Duron27 Jul 2, 2024
3aed6d9
Update CMakeLists.txt
Duron27 Jul 5, 2024
4217f33
Update CMakeLists.txt
Duron27 Jul 5, 2024
c553920
Update texture.c
Duron27 Jul 5, 2024
60de0f7
Update CMakeLists.txt
Duron27 Jul 6, 2024
f929e28
Update CMakeLists.txt
Duron27 Jul 6, 2024
aae34f5
Update CMakeLists.txt
Duron27 Jul 6, 2024
2f89b93
Update CMakeLists.txt
Duron27 Jul 6, 2024
981d0f6
Update CMakeLists.txt
Duron27 Jul 6, 2024
76b6e41
Update CMakeLists.txt
Duron27 Jul 6, 2024
b743f5a
Update CMakeLists.txt
Duron27 Jul 6, 2024
9dc44d2
Update CMakeLists.txt
Duron27 Jul 6, 2024
a54b523
Update CMakeLists.txt
Duron27 Jul 6, 2024
9866fb9
Update shader_hacks.c
Duron27 Jul 6, 2024
78aac99
Update shader_hacks.c
Duron27 Jul 6, 2024
34064af
Update shader_hacks.c
Duron27 Jul 6, 2024
879b497
Update shader_hacks.c
Duron27 Jul 6, 2024
874866b
Update shader_hacks.c
Duron27 Jul 6, 2024
022ed61
enable shader hacks
Duron27 Jul 6, 2024
9aea3e8
Update shader_hacks.c
Duron27 Jul 7, 2024
e2d5933
Update shader_hacks.c
Duron27 Jul 7, 2024
27e24d2
Update shader_hacks.c
Duron27 Jul 7, 2024
f4896dd
Update shader_hacks.c
Duron27 Jul 7, 2024
357e81b
Update shader_hacks.c
Duron27 Jul 7, 2024
b69ea4a
Update shader_hacks.c
Duron27 Jul 7, 2024
553b707
Update shader_hacks.c
Duron27 Jul 7, 2024
0d554bb
Update shader_hacks.c
Duron27 Jul 7, 2024
6079b77
Update shader_hacks.c
Duron27 Jul 7, 2024
28c36e0
Update shader_hacks.c
Duron27 Jul 7, 2024
e3b99b0
Update shader_hacks.c
Duron27 Jul 7, 2024
1b79dff
Update shader_hacks.c
Duron27 Jul 7, 2024
d80dfe9
Update shader_hacks.c
Duron27 Jul 7, 2024
43ae704
Update shader_hacks.c
Duron27 Jul 7, 2024
8c68dee
Update shader_hacks.c
Duron27 Jul 7, 2024
f842d89
Update shader_hacks.c
Duron27 Jul 7, 2024
10030d0
Update shader_hacks.c
Duron27 Jul 7, 2024
4df02f8
Update shader_hacks.c
Duron27 Jul 7, 2024
f6b73e2
Update CMakeLists.txt
Duron27 Jul 7, 2024
143902e
Update shader_hacks.c
Duron27 Jul 8, 2024
dc1fbfa
Update shader_hacks.c
Duron27 Jul 8, 2024
fddaad2
Update shader_hacks.c
Duron27 Jul 14, 2024
c217df5
Update shader_hacks.c
Duron27 Jul 15, 2024
524c0bb
Update shader_hacks.c
Duron27 Aug 2, 2024
5b3b359
Update shader_hacks.c
Duron27 Aug 2, 2024
642e8cb
Update shader_hacks.c
Duron27 Aug 2, 2024
5b4db27
Update shader_hacks.c
Duron27 Aug 2, 2024
07c7d41
Update shader_hacks.c
Duron27 Aug 8, 2024
a408262
Update shader_hacks.c
Duron27 Aug 8, 2024
bf368d3
Update shader_hacks.c
Duron27 Aug 8, 2024
64d5c0c
Update shader_hacks.c
Duron27 Aug 8, 2024
85b7033
Update shader_hacks.c
Duron27 Aug 8, 2024
70b3448
Update glext.h
Duron27 Aug 20, 2024
3b84da1
Update const.h
Duron27 Aug 20, 2024
142e126
Update debug.c
Duron27 Aug 20, 2024
07d765f
Update enum_info.h
Duron27 Aug 20, 2024
293045c
Update texture.c
Duron27 Aug 20, 2024
da5c29a
Update CMakeLists.txt
Duron27 Aug 20, 2024
ff06e46
Update texture.c
Duron27 Aug 20, 2024
11bb787
Update glext.h
Duron27 Aug 22, 2024
ba0d66a
Update const.h
Duron27 Aug 22, 2024
b783a2b
Update debug.c
Duron27 Aug 22, 2024
19db6f8
Update enum_info.h
Duron27 Aug 22, 2024
3716c21
Update texture.c
Duron27 Aug 22, 2024
6545419
Update CMakeLists.txt
Duron27 Aug 22, 2024
02b15e9
Update CMakeLists.txt
Duron27 Aug 22, 2024
4b0abe7
Update CMakeLists.txt
Duron27 Aug 24, 2024
0fb0ce7
Update CMakeLists.txt
Duron27 Aug 24, 2024
b78a349
Update CMakeLists.txt
Duron27 Aug 24, 2024
62e03ce
Update CMakeLists.txt
Duron27 Aug 24, 2024
5d4e480
Update CMakeLists.txt
Duron27 Aug 24, 2024
acb9b4e
Update CMakeLists.txt
Duron27 Aug 24, 2024
b9db2e5
Update CMakeLists.txt
Duron27 Aug 24, 2024
a60fab4
Update shaderconv.c
Duron27 Aug 25, 2024
37a4ba5
Update texture.c
Duron27 Aug 27, 2024
133b13c
add GL_R16F define
Duron27 Aug 27, 2024
c6ab647
Update shader_hacks.c
Duron27 Aug 28, 2024
8044f80
Update shader_hacks.c
Duron27 Aug 28, 2024
fa914cb
Update shader_hacks.c
Duron27 Aug 28, 2024
923d3ec
Update init.c
Duron27 Aug 28, 2024
36ee565
Update program.c
Duron27 Aug 29, 2024
3a7c33d
Update program.c
Duron27 Aug 29, 2024
6897417
Update program.c
Duron27 Aug 29, 2024
06762ea
Update program.c
Duron27 Aug 29, 2024
24de6cf
Update program.c
Duron27 Aug 29, 2024
60daa47
Update program.c
Duron27 Aug 29, 2024
a8104ff
Update program.c
Duron27 Aug 29, 2024
516f467
Update shaderconv.c
Duron27 Aug 29, 2024
100f739
Update shaderconv.c
Duron27 Aug 29, 2024
95ece5e
Update shaderconv.c
Duron27 Aug 30, 2024
f3db6db
Update shaderconv.c
Duron27 Aug 30, 2024
8013ed5
Update CMakeLists.txt
Duron27 Sep 16, 2024
3e9cee8
Update hint.c
Duron27 Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,24 @@ LOCAL_SRC_FILES := \
src/glx/lookup.c \
src/glx/gbm.c \
src/glx/streaming.c \
src/gl/libtxc_dxtn/txc_compress_dxtn.c \

LOCAL_CFLAGS += -g -std=gnu99 -funwind-tables -O3 -fvisibility=hidden -include include/android_debug.h
LOCAL_CFLAGS += -std=gnu99 -funwind-tables -O3 -fvisibility=hidden -include include/android_debug.h
LOCAL_CFLAGS += -DNOX11
LOCAL_CFLAGS += -DNO_GBM
#LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR
LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR=ON
LOCAL_CFLAGS += -DNOEGL=ON
LOCAL_CFLAGS += -DNO_LOADER=ON
LOCAL_CFLAGS += -DDEFAULT_ES=2
LOCAL_CFLAGS += -Wno-typedef-redefinition -Wno-dangling-else
LOCAL_CFLAGS += -Dasm=__asm__ -Dvolatile=__volatile__
LOCAL_CFLAGS += -include include/gl4esinit.h

//TODO: maybe temporary?
LOCAL_CFLAGS += -Wno-typedef-redefinition -Wno-dangling-else

LOCAL_LDLIBS := -llog
#building as a static lib
#building as a shared lib

LOCAL_CFLAGS += -DSTATICLIB
include $(BUILD_STATIC_LIBRARY)
LOCAL_CFLAGS += -DSHAREDLIB
include $(BUILD_SHARED_LIBRARY)
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ endif()
# Android
if(ANDROID)
add_definitions(-DANDROID)
add_definitions(-DNOX11 -DNO_GBM -DDEFAULT_ES=2)
add_definitions(-DNOX11 -DNO_GBM -DDEFAULT_ES=2 -o libGL.so)
endif()

if(USE_ANDROID_LOG)
Expand Down Expand Up @@ -192,13 +192,13 @@ if(NOT WIN32_MSVC)
if(NOT WIN32_PLATFORM)
add_definitions(-fvisibility=hidden)
else()
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--exclude-all-symbols,--kill-at")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--exclude-all-symbols,--kill-at -latomic -no-canonical-prefixes -Wl,--gc-sections -Wl,--build-id=sha1 -Wl,--no-dangling-else -Wl,--no-rosegment -Wl,--no-undefined -Wl,--fatal-warnings -Wl,--no-undefined-version -llog -landroid -lc -lm -o libGL.so")
endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
add_definitions(-Wno-deprecated-declarations) #strdup
add_definitions(-Wno-unused-function -Wno-unused-variable -Wno-dangling-else)
add_definitions(-Wno-implicit-const-int-float-conversion)
add_definitions(-Wno-visibility)
add_definitions(-Wno-visibility -Wno-logical-not-parentheses)
else()
if(CMAKE_C_COMPILER_ID MATCHES "Intel")
add_definitions(-wd1786 -wd589 -wd537 -wd118 -wd2722)
Expand Down
6 changes: 3 additions & 3 deletions include/GL/glext.h
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ extern "C" {
#define GL_CLAMP_READ_COLOR_ARB 0x891C
#define GL_FIXED_ONLY_ARB 0x891D
#endif

#ifndef GL_ARB_half_float_pixel
#define GL_HALF_FLOAT_ARB 0x140B
#endif
Expand Down Expand Up @@ -1663,7 +1663,7 @@ extern "C" {
/* reuse GL_MAX_VARYING_COMPONENTS */
/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
#endif

#ifndef GL_ARB_half_float_vertex
#define GL_HALF_FLOAT 0x140B
#endif
Expand Down Expand Up @@ -4070,7 +4070,7 @@ extern "C" {
#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
#define GL_PROGRAM_ERROR_STRING_NV 0x8874
#endif

#ifndef GL_NV_half_float
#define GL_HALF_FLOAT_NV 0x140B
#endif
Expand Down
46 changes: 26 additions & 20 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ include_directories(util)
#file(GLOB_RECURSE GL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/gl/*.c)
SET(GL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbconverter.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbgenerator.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbhelper.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbparser.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbgenerator.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbhelper.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbparser.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/array.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/blit.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/blend.c
Expand Down Expand Up @@ -66,23 +66,26 @@ SET(GL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/gl/texture_3d.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/uniform.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/vertexattrib.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/wrap/gl4eswraps.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/wrap/gles.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/wrap/glstub.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/math/matheval.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/wrap/gl4eswraps.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/wrap/gles.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/wrap/glstub.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/math/matheval.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/libtxc_dxtn/txc_compress_dxtn.c
${CMAKE_CURRENT_SOURCE_DIR}/gl/libtxc_dxtn/txc_dxtn.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/libtxc_dxtn/txc_fetch_dxtn.c
)

SET(GL_H
${CMAKE_CURRENT_SOURCE_DIR}/../version.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbconverter.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbgenerator.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbhelper.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbparser.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbgenerator.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbhelper.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/arbparser.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/array.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/blend.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/blit.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/buffers.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/build_info.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/build_info.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/const.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/debug.h
${CMAKE_CURRENT_SOURCE_DIR}/gl/decompress.h
Expand Down Expand Up @@ -144,11 +147,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT NO_LOADER)
list(APPEND GL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/glx/hardext.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/gbm.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/glx.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/glx_stubs.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/lookup.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/glx.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/glx_stubs.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/lookup.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/rpi.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/streaming.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/streaming.c
${CMAKE_CURRENT_SOURCE_DIR}/glx/utils.c
)
list(APPEND GL_H
Expand Down Expand Up @@ -221,14 +224,17 @@ else()
endif()

if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so")
set_target_properties(GL PROPERTIES SUFFIX ".so.1")
set_target_properties(GL PROPERTIES SUFFIX ".so")
endif()
install(TARGETS GL
LIBRARY
DESTINATION "/usr/lib/gl4es/"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/"
)
install(FILES "../include/gl4esinit.h" "../include/gl4eshint.h"
DESTINATION "/usr/include/gl4es/"
install(DIRECTORY "../include/"
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/gl4es"
)
install(DIRECTORY "../include/"
DESTINATION "${CMAKE_INSTALL_PREFIX}/include"
)
endif()

Expand All @@ -249,7 +255,7 @@ if(EGL_WRAPPER)
target_link_libraries(EGL ${log-lib})
endif()
if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so")
set_target_properties(EGL PROPERTIES SUFFIX ".so.1")
set_target_properties(EGL PROPERTIES SUFFIX ".so")
endif()
endif()

1 change: 1 addition & 0 deletions src/gl/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
#define GL_INTENSITY16F 0x881D
#define GL_INTENSITY32F 0x8817
#define GL_RGB10_A2 0x8059
#define GL_R16F 0x822D
#define GL_RGBA16F 0x881A
#define GL_RGB16F 0x881B
#define GL_RGBA32F 0x8814
Expand Down
2 changes: 1 addition & 1 deletion src/gl/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,4 @@ void CheckGLError(int fwd) {
if(fwd)
errorShim(err);
}
}
}
2 changes: 1 addition & 1 deletion src/gl/enum_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ static inline const GLboolean valid_vertex_type(GLenum type) {
}
}

#endif // _GL4ES_ENUM_INFO_H
#endif // _GL4ES_ENUM_INFO_H
1 change: 1 addition & 0 deletions src/gl/fpe.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ typedef struct fpe_state_s {
unsigned int blendeqalpha:3;
uint16_t vertex_prg_id; // Id of vertex program currently binded (0 most of the time), 16bits is more than enough...
uint16_t fragment_prg_id; // Id of fragment program currently binded (0 most of the time)
int16_t gamma;
} fpe_state_t;
#pragma pack()

Expand Down
12 changes: 9 additions & 3 deletions src/gl/fpe_shader.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const char* const* fpe_VertexShader(shaderconv_need_t* need, fpe_state_t *state)
int cm_back_nullexp = state->cm_back_nullexp;
int texgens = 0;
int texmats = 0;
const char* fogp = hardext.highp?"highp":"mediump";
const char* fogp = "highp";

for (int i=0; i<hardext.maxtex; ++i) {
if(state->texgen[i].texgen_s || state->texgen[i].texgen_t || state->texgen[i].texgen_r || state->texgen[i].texgen_q)
Expand Down Expand Up @@ -837,7 +837,7 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat
int texenv_combine = 0;
int texturing = 0;
char buff[1024];
const char* fogp = hardext.highp?"highp":"mediump";
const char* fogp = "highp";


strcpy(shad, fpeshader_signature);
Expand Down Expand Up @@ -1376,7 +1376,8 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat
sprintf(buff, "%s float FogF = clamp(exp(-(gl_Fog.density * fog_c)*(gl_Fog.density * fog_c)), 0., 1.);\n", fogp);
break;
case FPE_FOG_LINEAR:
sprintf(buff, "%s float FogF = clamp((gl_Fog.end - fog_c) %s, 0., 1.);\n", fogp, hardext.highp?"* gl_Fog.scale":"/ (gl_Fog.end - gl_Fog.start)");
//sprintf(buff, "%s float FogF = clamp((gl_Fog.end - fog_c) %s, 0., 1.);\n", fogp, hardext.highp?"* gl_Fog.scale":"/ (gl_Fog.end - gl_Fog.start)");
sprintf(buff, "%s float FogF = clamp((gl_Fog.end - fog_c) * gl_Fog.scale, 0., 1.);\n", fogp);
break;
}
ShadAppend(buff);
Expand Down Expand Up @@ -1618,6 +1619,11 @@ const char* const* fpe_FragmentShader(shaderconv_need_t* need, fpe_state_t *stat
}
}

if (state->gamma) {
sprintf(buff, "fColor.rgb = pow(fColor.rgb, vec3(1.0 / %.3f));\n", state->gamma / 100.0);
ShadAppend(buff);
}

//done
ShadAppend("gl_FragColor = fColor;\n");
ShadAppend("}");
Expand Down
28 changes: 23 additions & 5 deletions src/gl/getter.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ void BuildExtensionsList() {
"GL_EXT_draw_range_elements "
"GL_EXT_bgra "
"GL_ARB_texture_compression "
"GL_EXT_texture_compression_s3tc "
"GL_OES_texture_compression_S3TC "
"GL_EXT_texture_compression_dxt1 "
"GL_EXT_texture_compression_dxt3 "
"GL_EXT_texture_compression_dxt5 "
"GL_ARB_point_parameters "
"GL_EXT_point_parameters "
"GL_EXT_stencil_wrap "
Expand All @@ -133,6 +128,15 @@ void BuildExtensionsList() {
"GL_NV_blend_square "
// "GL_EXT_blend_logic_op "
);

if (globals4es.dxt != 2)
strcat(extensions, "GL_EXT_texture_compression_s3tc "
"GL_OES_texture_compression_S3TC "
"GL_EXT_texture_compression_dxt1 "
"GL_EXT_texture_compression_dxt3 "
"GL_EXT_texture_compression_dxt5 ");


if(!globals4es.notexrect)
strcat(extensions, "GL_ARB_texture_rectangle ");
if(globals4es.vabgra)
Expand Down Expand Up @@ -177,16 +181,30 @@ void BuildExtensionsList() {
if(hardext.floattex || (globals4es.floattex==2)) {
strcat(extensions, "GL_EXT_texture_float ");
strcat(extensions, "GL_ARB_texture_float ");
strcat(extensions, "GL_OES_texture_float ");
}
if(hardext.floattexlinear || (globals4es.floattex==2)) {
strcat(extensions, "GL_EXT_texture_float_linear ");
strcat(extensions, "GL_OES_texture_float_linear ");
}
if(hardext.halffloattex || (globals4es.floattex==2)) {
strcat(extensions, "GL_EXT_texture_half_float ");
strcat(extensions, "GL_OES_texture_half_float ");
}
if(hardext.halffloattexlinear || (globals4es.floattex==2)) {
strcat(extensions, "GL_EXT_texture_half_float_linear ");
strcat(extensions, "GL_OES_texture_half_float_linear ");
}
if(hardext.floatfbo || (globals4es.floattex==2)) {
strcat(extensions, "GL_EXT_color_buffer_float ");
}
if(hardext.halffloatfbo || (globals4es.floattex==2)) {
strcat(extensions, "GL_EXT_color_buffer_half_float ");
}
if(hardext.clipcontrol) {
strcat(extensions, "GL_ARB_clip_control ");
strcat(extensions, "GL_EXT_clip_control ");
}
if(hardext.depthtex) {
strcat(extensions, "GL_EXT_depth_texture ");
strcat(extensions, "GL_ARB_depth_texture ");
Expand Down
3 changes: 2 additions & 1 deletion src/gl/hint.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "loader.h"
#include "gl4es.h"
#include "glstate.h"
#include "fpe_cache.h"

#ifdef PANDORA
void pandora_set_gamma();
Expand Down Expand Up @@ -132,4 +133,4 @@ void APIENTRY_GL4ES gl4es_glHint(GLenum pname, GLenum mode) {
gles_glHint(pname, mode);
}
}
AliasExport(void,glHint,,(GLenum pname, GLenum mode));
AliasExport(void,glHint,,(GLenum pname, GLenum mode));
32 changes: 30 additions & 2 deletions src/gl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,25 @@ void initialize_gl4es() {
env(LIBGL_XREFRESH, globals4es.xrefresh, "xrefresh will be called on cleanup");
env(LIBGL_STACKTRACE, globals4es.stacktrace, "stacktrace will be printed on crash");

switch(ReturnEnvVarInt("LIBGL_DXT")) {
case 1:
SHUT_LOGD("forcing software DXT decompression\n");
globals4es.dxt = 1;
break;
case 2:
SHUT_LOGD("not exposing DXT support\n");
globals4es.dxt = 2;
break;
case 3:
SHUT_LOGD("handling DXT as is\n");
globals4es.dxt = 3;
break;
default:
SHUT_LOGD("using hardware DXT if supported + software fallback\n");
globals4es.dxt = 0;
break;
}


switch(ReturnEnvVarInt("LIBGL_FB")) {
case 1:
Expand Down Expand Up @@ -626,7 +645,7 @@ void initialize_gl4es() {
env(LIBGL_NOES2COMPAT, globals4es.noes2, "Don't expose GLX_EXT_create_context_es2_profile extension");
env(LIBGL_NORMALIZE, globals4es.normalize, "Force normals to be normalized on FPE shaders");

globals4es.dbgshaderconv=ReturnEnvVarIntDef("LIBGL_DBGSHADERCONV",0);
globals4es.dbgshaderconv=1;//ReturnEnvVarIntDef("LIBGL_DBGSHADERCONV",0);
if(globals4es.dbgshaderconv) {
if(globals4es.dbgshaderconv==1)
globals4es.dbgshaderconv=15;
Expand Down Expand Up @@ -677,6 +696,7 @@ void initialize_gl4es() {
if(globals4es.nopsa==0) {
cwd[0]='\0';
// TODO: What to do on ANDROID and EMSCRIPTEN?
/*
const char* custom_psa = GetEnvVar("LIBGL_PSA_FOLDER");
#ifdef __linux__
const char* home = GetEnvVar("HOME");
Expand All @@ -693,8 +713,16 @@ void initialize_gl4es() {
else
strcpy(cwd, "PROGDIR:");
#endif

*/

strcpy(cwd, GetEnvVar("OPENMW_USER_FILE_STORAGE"));

if(strlen(cwd)) {
strcat(cwd, ".gl4es.psa");
if(globals4es.nohighp)
strcat(cwd, ".gl4es.psa-mediump");
else
strcat(cwd, ".gl4es.psa-highp");
fpe_InitPSA(cwd);
fpe_readPSA();
}
Expand Down
1 change: 1 addition & 0 deletions src/gl/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ typedef struct _globals4es {
int mergelist;
int xrefresh;
int stacktrace;
int dxt;
int usefb;
int usegbm;
int usefbo;
Expand Down
Loading