LWJGL Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2 3 ... 10
 1 
 on: September 12, 2017, 17:20:22 
Started by atom - Last post by atom
Hello, i am unable to get a compatibility profile, but core profile is ok.

This sample code :
Code: [Select]
public static void main(String[] args) {
    GLFWErrorCallback.createPrint(System.err).set();
    if (!glfwInit()) {
        throw new IllegalStateException("Unable to initialize GLFW");
    }
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);
    long handle = glfwCreateWindow(100, 100, "test", NULL, NULL);
    glfwMakeContextCurrent(handle);
    GL.createCapabilities();
    System.out.println("OpenGL version : "+glGetString(GL_VERSION));
}
gives me:
Quote
[LWJGL] Version: 3.1.2 build 29
[LWJGL]     OS: Linux v4.13.1-1-ARCH
[LWJGL]    JRE: 1.8.0_144 amd64
[LWJGL]    JVM: OpenJDK 64-Bit Server VM v25.144-b01 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl.so
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loading library: jemalloc
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libjemalloc.so
[LWJGL] MemoryUtil allocator: DebugAllocator
[LWJGL] Loading library: glfw
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libglfw.so
[LWJGL] GLFW_VERSION_UNAVAILABLE error
   Description : GLX: Failed to create context: GLXBadFBConfig
   Stacktrace  :
      org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1361)
      org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1521)
      org.lwjglx.debug.glfw.GLFW.glfwCreateWindow(GLFW.java:380)
      org.lwjglx.debug.$Proxy$1.4(Unknown Source)
      CrashCompatibilityProfile.main(CrashCompatibilityProfile.java:30)
[LWJGL] GLFW_VERSION_UNAVAILABLE error
   Description : GLX: Failed to create context: GLXBadFBConfig
   Stacktrace  :
      org.lwjgl.system.JNI.invokePPPP(Native Method)
      org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1361)
      org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1521)
      org.lwjglx.debug.glfw.GLFW.glfwCreateWindow(GLFW.java:380)
      org.lwjglx.debug.$Proxy$1.4(Unknown Source)
      CrashCompatibilityProfile.main(CrashCompatibilityProfile.java:30)
[error] Failed to create GLFW window
[LWJGL] Loading library (system): lwjgl_opengl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl_opengl.so
[LWJGL] Loading library: libGL.so.1
[LWJGL]    libGL.so.1 not found in org.lwjgl.librarypath=natives
[LWJGL]    Loaded from system paths

and this sample code :
Code: [Select]
public static void main(String[] args) {
    GLFWErrorCallback.createPrint(System.err).set();
    if (!glfwInit()) {
        throw new IllegalStateException("Unable to initialize GLFW");
    }
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    long handle = glfwCreateWindow(100, 100, "test", NULL, NULL);
    glfwMakeContextCurrent(handle);
    GL.createCapabilities();
    System.out.println("OpenGL version : "+glGetString(GL_VERSION));
}
gives me that :
Quote
[LWJGL] Version: 3.1.2 build 29
[LWJGL]     OS: Linux v4.13.1-1-ARCH
[LWJGL]    JRE: 1.8.0_144 amd64
[LWJGL]    JVM: OpenJDK 64-Bit Server VM v25.144-b01 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl.so
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loading library: jemalloc
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libjemalloc.so
[LWJGL] MemoryUtil allocator: DebugAllocator
[LWJGL] Loading library: glfw
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/libglfw.so
[LWJGL] Loading library (system): lwjgl_opengl
[LWJGL]    Loaded from org.lwjgl.librarypath: natives/liblwjgl_opengl.so
[LWJGL] Loading library: libGL.so.1
[LWJGL]    libGL.so.1 not found in org.lwjgl.librarypath=natives
[LWJGL]    Loaded from system paths
[LWJGL] [GL] Using OpenGL 4.3 for error logging.
[info ][1] Initialized OpenGL context for window[1]
  Effective OpenGL version: 4.5
  OpenGL version string   : 4.5 (Core Profile) Mesa 17.2.0
  OpenGL vendor           : X.Org
  OpenGL renderer         : AMD Radeon (TM) RX 480 Graphics (AMD POLARIS10 / DRM 3.18.0 / 4.13.1-1-ARCH, LLVM 4.0.1)
  GL_MAX_VERTEX_ATTRIBS   : 16
  Capabilities:
        1      GL_AMD_conservative_depth GL_AMD_draw_buffers_blend GL_AMD_performance_monitor
        2      GL_AMD_pinned_memory GL_AMD_seamless_cubemap_per_texture
        3      GL_AMD_shader_stencil_export GL_AMD_shader_trinary_minmax
        4      GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index
        5      GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture
        6      GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object
        7      GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float
        8      GL_ARB_compressed_texture_pixel_storage GL_ARB_compute_shader
        9      GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted
       10      GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_copy_image
       11      GL_ARB_cull_distance GL_ARB_debug_output GL_ARB_depth_buffer_float
       12      GL_ARB_depth_clamp GL_ARB_derivative_control GL_ARB_direct_state_access
       13      GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex
       14      GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_enhanced_layouts
       15      GL_ARB_ES2_compatibility GL_ARB_ES3_1_compatibility GL_ARB_ES3_2_compatibility
       16      GL_ARB_ES3_compatibility GL_ARB_explicit_attrib_location
       17      GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions
       18      GL_ARB_fragment_layer_viewport GL_ARB_fragment_shader
       19      GL_ARB_framebuffer_no_attachments GL_ARB_framebuffer_object
       20      GL_ARB_framebuffer_sRGB GL_ARB_get_program_binary GL_ARB_get_texture_sub_image
       21      GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader_int64
       22      GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_indirect_parameters
       23      GL_ARB_instanced_arrays GL_ARB_internalformat_query
       24      GL_ARB_internalformat_query2 GL_ARB_invalidate_subdata
       25      GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind
       26      GL_ARB_multi_draw_indirect GL_ARB_occlusion_query2
       27      GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_sprite
       28      GL_ARB_program_interface_query GL_ARB_provoking_vertex
       29      GL_ARB_query_buffer_object GL_ARB_robust_buffer_access_behavior
       30      GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects
       31      GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture
       32      GL_ARB_separate_shader_objects GL_ARB_shader_atomic_counter_ops
       33      GL_ARB_shader_atomic_counters GL_ARB_shader_bit_encoding GL_ARB_shader_clock
       34      GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote
       35      GL_ARB_shader_image_load_store GL_ARB_shader_image_size GL_ARB_shader_objects
       36      GL_ARB_shader_precision GL_ARB_shader_stencil_export
       37      GL_ARB_shader_storage_buffer_object GL_ARB_shader_subroutine
       38      GL_ARB_shader_texture_image_samples GL_ARB_shader_texture_lod
       39      GL_ARB_shader_viewport_layer_array GL_ARB_shading_language_420pack
       40      GL_ARB_shading_language_packing GL_ARB_sparse_buffer GL_ARB_stencil_texturing
       41      GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_barrier
       42      GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32
       43      GL_ARB_texture_buffer_range GL_ARB_texture_compression_bptc
       44      GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map_array
       45      GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge
       46      GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two
       47      GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle
       48      GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_stencil8
       49      GL_ARB_texture_storage GL_ARB_texture_storage_multisample
       50      GL_ARB_texture_swizzle GL_ARB_texture_view GL_ARB_timer_query
       51      GL_ARB_transform_feedback2 GL_ARB_transform_feedback3
       52      GL_ARB_transform_feedback_instanced GL_ARB_uniform_buffer_object
       53      GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit
       54      GL_ARB_vertex_attrib_binding GL_ARB_vertex_shader
       55      GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev
       56      GL_ARB_viewport_array GL_ATI_meminfo GL_EXT_abgr GL_EXT_blend_equation_separate
       57      GL_EXT_depth_bounds_test GL_EXT_draw_buffers2 GL_EXT_draw_instanced
       58      GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample
       59      GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_sRGB
       60      GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_pixel_buffer_object
       61      GL_EXT_polygon_offset_clamp GL_EXT_provoking_vertex GL_EXT_shader_integer_mix
       62      GL_EXT_texture_array GL_EXT_texture_compression_rgtc
       63      GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic
       64      GL_EXT_texture_integer GL_EXT_texture_mirror_clamp
       65      GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_sRGB
       66      GL_EXT_texture_sRGB_decode GL_EXT_texture_swizzle GL_EXT_timer_query
       67      GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_KHR_context_flush_control
       68      GL_KHR_debug GL_KHR_no_error GL_KHR_robust_buffer_access_behavior
       69      GL_KHR_robustness GL_NV_conditional_render GL_NV_depth_clamp
       70      GL_NV_packed_depth_stencil GL_NV_texture_barrier GL_NVX_gpu_memory_info
       71      forwardCompatible
OpenGL version : 4.5 (Core Profile) Mesa 17.2.0

I've read somewhere else that mesa doesn't provide compatibility context, is that true?
Do I do something wrong?

 2 
 on: September 11, 2017, 17:28:52 
Started by Just_A_Fork - Last post by Just_A_Fork
IntBuffer.allocate is being used in Sprite.java, which creates an IntBuffer backed by a Java heap array. This is not supported in LWJGL, off-heap buffers are required. Please read the Memory FAQ for more details and the recommended allocation strategies.

thank you so much it's working well now

 3 
 on: September 11, 2017, 15:03:45 
Started by Just_A_Fork - Last post by Cornix
I meant laziness from the users who rather ask in the forums instead of using the Debug build to find out what went wrong immediately.

There isnt much you can do about lazy users.

 4 
 on: September 11, 2017, 15:03:00 
Started by Just_A_Fork - Last post by spasi
What is lazy exactly?

 5 
 on: September 11, 2017, 13:17:34 
Started by Just_A_Fork - Last post by Cornix
Well, in that case I guess its just laziness.

 6 
 on: September 11, 2017, 10:50:53 
Started by Just_A_Fork - Last post by spasi
This error, and many more, are covered by LWJGLX/debug.

 7 
 on: September 11, 2017, 09:17:26 
Started by Just_A_Fork - Last post by Cornix
There are a lot of threads all with the same problem recently. Would it be possible to detect such a situation programmatically within LWJGL3 and print an appropriate error message?

 8 
 on: September 11, 2017, 06:52:47 
Started by Just_A_Fork - Last post by spasi
IntBuffer.allocate is being used in Sprite.java, which creates an IntBuffer backed by a Java heap array. This is not supported in LWJGL, off-heap buffers are required. Please read the Memory FAQ for more details and the recommended allocation strategies.

 9 
 on: September 11, 2017, 02:38:44 
Started by Just_A_Fork - Last post by Just_A_Fork
I don't know why but keep getting this error (hs_err_pid6886.log) from java every time I run Main. if I comment it out it doesn't send the error if I comment it out so I'm pretty sure it's the problem. I think it might be a memory leak but if so I have no clue on how to fix it

note that I am using a mac to write this and I want it to be able to run on a mac. also, I am very new to lwjgl though I do have a little experience with c++ but only messing around.

 10 
 on: September 10, 2017, 16:31:36 
Started by Maineri - Last post by voidburn
I was curious as to why a sleeper deamonized thread was needed to accomplish this, and found the following information about it:

To try and alleviate the low granularity, the VM actually makes a special call to set the interrupt period to 1ms while any Java thread is sleeping, if it requests a sleep interval that is not a multiple of 10ms. This means you are actually making a system-wide change to interrupt behavior (although generally not such a problem).

Generally, the solution works well enough, but: there is also a bug in Windows (XP, 2000, 2003) whereby repeatedly altering the interrupt period (and hence, repeatedly sleeping in Java for periods that are not multiples of 10ms)can make the system clock run faster than normal. Hotspot assumes that the default interrupt period is 10ms, but on some hardware it is 15ms.

If timing is crucial to your application, then an inelegant but practical way to get round these bugs is to leave a daemon thread running throughout the duration of your application that simply sleeps for a large prime number of milliseconds (Long.MAX_VALUE for example). This way, the interrupt period will be set once per invocation of your application, minimizing the effect on the system clock, and setting the sleep granularity to 1ms even where the default interrupt period isn't 15ms.

REFERENCES:
1) http://javamex.com/tutorials/threads/sleep_issues.shtml
2) https://support.microsoft.com/en-us/help/821893/the-system-clock-may-run-fast-when-you-use-the-acpi-power-management-t

Pages: [1] 2 3 ... 10