modes detection errors

This commit is contained in:
2018-11-03 03:19:15 +07:00
parent e7bebf935a
commit c5a5c41f26
6 changed files with 39 additions and 27 deletions

View File

@@ -137,7 +137,7 @@ set(E2D_LIBRARIES
${CMAKE_THREAD_LIBS_INIT})
if(APPLE)
list(APPEND ${E2D_LIBRARIES}
list(APPEND E2D_LIBRARIES
${Cocoa}
${IOKit}
${CoreVideo}

View File

@@ -25,3 +25,7 @@
# define E2D_RENDER_MODE E2D_RENDER_MODE_OPENGL
# endif
#endif
#ifndef E2D_RENDER_MODE
# error E2D_RENDER_MODE not detected
#endif

View File

@@ -978,37 +978,37 @@ namespace e2d
case pixel_declaration::pixel_type::depth16:
return true;
case pixel_declaration::pixel_type::depth24:
return __GLEW_OES_depth24;
return GLEW_OES_depth24;
case pixel_declaration::pixel_type::depth32:
return __GLEW_OES_depth32;
return GLEW_OES_depth32;
case pixel_declaration::pixel_type::depth24_stencil8:
return __GLEW_OES_packed_depth_stencil
|| __GLEW_EXT_packed_depth_stencil;
return GLEW_OES_packed_depth_stencil
|| GLEW_EXT_packed_depth_stencil;
case pixel_declaration::pixel_type::rgb8:
case pixel_declaration::pixel_type::rgba8:
return true;
case pixel_declaration::pixel_type::rgb_dxt1:
case pixel_declaration::pixel_type::rgba_dxt1:
return __GLEW_ANGLE_texture_compression_dxt1
|| __GLEW_EXT_texture_compression_dxt1
|| __GLEW_EXT_texture_compression_s3tc
|| __GLEW_NV_texture_compression_s3tc;
return GLEW_ANGLE_texture_compression_dxt1
|| GLEW_EXT_texture_compression_dxt1
|| GLEW_EXT_texture_compression_s3tc
|| GLEW_NV_texture_compression_s3tc;
case pixel_declaration::pixel_type::rgba_dxt3:
return __GLEW_ANGLE_texture_compression_dxt3
|| __GLEW_EXT_texture_compression_s3tc
|| __GLEW_NV_texture_compression_s3tc;
return GLEW_ANGLE_texture_compression_dxt3
|| GLEW_EXT_texture_compression_s3tc
|| GLEW_NV_texture_compression_s3tc;
case pixel_declaration::pixel_type::rgba_dxt5:
return __GLEW_ANGLE_texture_compression_dxt5
|| __GLEW_EXT_texture_compression_s3tc
|| __GLEW_NV_texture_compression_s3tc;
return GLEW_ANGLE_texture_compression_dxt5
|| GLEW_EXT_texture_compression_s3tc
|| GLEW_NV_texture_compression_s3tc;
case pixel_declaration::pixel_type::rgb_pvrtc2:
case pixel_declaration::pixel_type::rgb_pvrtc4:
case pixel_declaration::pixel_type::rgba_pvrtc2:
case pixel_declaration::pixel_type::rgba_pvrtc4:
return __GLEW_IMG_texture_compression_pvrtc;
return GLEW_IMG_texture_compression_pvrtc;
case pixel_declaration::pixel_type::rgba_pvrtc2_v2:
case pixel_declaration::pixel_type::rgba_pvrtc4_v2:
return __GLEW_IMG_texture_compression_pvrtc2;
return GLEW_IMG_texture_compression_pvrtc2;
default:
E2D_ASSERT_MSG(false, "unexpected pixel type");
return false;
@@ -1025,7 +1025,7 @@ namespace e2d
#if E2D_RENDER_MODE == E2D_RENDER_MODE_OPENGL
return true;
#elif E2D_RENDER_MODE == E2D_RENDER_MODE_OPENGLES
return __GLEW_OES_element_index_uint;
return GLEW_OES_element_index_uint;
#else
# error unknown render mode
#endif

View File

@@ -1297,19 +1297,19 @@ namespace e2d { namespace opengl
caps.max_fragment_uniform_vectors = math::numeric_cast<u32>(max_fragment_uniform_vectors);
caps.npot_texture_supported =
__GLEW_OES_texture_npot ||
__GLEW_ARB_texture_non_power_of_two;
GLEW_OES_texture_npot ||
GLEW_ARB_texture_non_power_of_two;
caps.depth_texture_supported =
__GLEW_OES_depth_texture ||
__GLEW_ARB_depth_texture ||
__GLEW_ANGLE_depth_texture ||
__GLEW_SGIX_depth_texture;
GLEW_OES_depth_texture ||
GLEW_ARB_depth_texture ||
GLEW_ANGLE_depth_texture ||
GLEW_SGIX_depth_texture;
caps.render_target_supported =
__GLEW_OES_framebuffer_object ||
__GLEW_ARB_framebuffer_object ||
__GLEW_EXT_framebuffer_object;
GLEW_OES_framebuffer_object ||
GLEW_ARB_framebuffer_object ||
GLEW_EXT_framebuffer_object;
}
gl_shader_id gl_compile_shader(debug& debug, const str& source, GLenum type) noexcept {

View File

@@ -23,3 +23,7 @@
# define E2D_WINDOW_MODE E2D_WINDOW_MODE_GLFW
# endif
#endif
#ifndef E2D_WINDOW_MODE
# error E2D_WINDOW_MODE not detected
#endif

View File

@@ -25,6 +25,10 @@
# endif
#endif
#ifndef E2D_FILES_MODE
# error E2D_FILES_MODE not detected
#endif
namespace e2d { namespace impl
{
read_file_uptr make_read_file(str_view path) noexcept;