In OpenTK you should be able to get this data with the function OpenTK.Graphics.OpenGL.GL.GetString.Originally Posted by BeoWulf
Just call it somewhere after you initialized your gamewindow and output the results.
In OpenTK you should be able to get this data with the function OpenTK.Graphics.OpenGL.GL.GetString.Originally Posted by BeoWulf
Just call it somewhere after you initialized your gamewindow and output the results.
Thx a lot!
Here are the Laptop-Properties:
Here are the PC-Properties:GL_VERSION: 3.0.0 - Build 8.15.10.2353
GL_EXTENSION: GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_blend_color GL_EXT_abgr GL_EXT_texture3D GL_EXT_clip_volume_hint GL_EXT_compiled_vertex_array GL_SGIS_texture_edge_clamp GL_SGIS_generate_mipmap GL_EXT_draw_range_elements GL_SGIS_texture_lod GL_EXT_rescale_normal GL_EXT_packed_pixels GL_EXT_texture_edge_clamp GL_EXT_separate_specular_color GL_ARB_multitexture GL_EXT_texture_env_combine GL_EXT_bgra GL_EXT_blend_func_separate GL_EXT_secondary_color GL_EXT_fog_coord GL_EXT_texture_env_add GL_ARB_texture_cube_map GL_ARB_transpose_matrix GL_ARB_texture_env_add GL_IBM_texture_mirrored_repeat GL_EXT_multi_draw_arrays GL_NV_blend_square GL_ARB_texture_compression GL_3DFX_texture_compression_FXT1 GL_EXT_texture_filter_anisotropic GL_ARB_texture_border_clamp GL_ARB_point_parameters GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_env_crossbar GL_EXT_texture_compression_s3tc GL_ARB_shadow GL_ARB_window_pos GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_ARB_vertex_program GL_EXT_texture_rectangle GL_ARB_fragment_program GL_EXT_stencil_two_side GL_ATI_separate_stencil GL_ARB_vertex_buffer_object GL_EXT_texture_lod_bias GL_ARB_occlusion_query GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_texture_non_power_of_two GL_ARB_vertex_shader GL_NV_texgen_reflection GL_ARB_point_sprite GL_EXT_blend_equation_separate GL_ARB_depth_texture GL_ARB_texture_rectangle GL_ARB_draw_buffers GL_ARB_color_buffer_float GL_ARB_half_float_pixel GL_ARB_texture_float GL_ARB_pixel_buffer_object GL_EXT_framebuffer_object GL_ARB_draw_instanced GL_ARB_half_float_vertex GL_EXT_draw_buffers2 GL_WIN_swap_hint GL_EXT_texture_sRGB GL_ARB_multisample GL_EXT_packed_float GL_EXT_texture_shared_exponent GL_ARB_texture_rg GL_ARB_texture_compression_rgtc GL_NV_conditional_render GL_EXT_texture_swizzle GL_ARB_framebuffer_sRGB GL_EXT_packed_depth_stencil GL_ARB_depth_buffer_float GL_EXT_transform_feedback GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_ARB_framebuffer_object GL_EXT_texture_array GL_EXT_texture_integer GL_ARB_map_buffer_range GL_EXT_texture_snorm GL_INTEL_performance_queries GL_ARB_vertex_array_object
GL_VENDOR: Intel
GL_RENDERER: Intel(R) HD Graphics Family
GL_ShadingLanguageVersion: 1.30 - Intel Build 8.15.10.2353
I thought OpenGL will be updated automatically by Windows-Update, but i got no one?GL_VERSION: 4.1.10600 Compatibility Profile Context
GL_EXTENSION: GL_AMDX_debug_output GL_AMDX_vertex_shader_tessellator GL_AMD_conservative_depth GL_AMD_debug_output GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_name_gen_delete GL_AMD_performance_monitor GL_AMD_sample_positions GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_stencil_export GL_AMD_shader_trace GL_AMD_texture_cube_map_array GL_AMD_texture_texture4 GL_AMD_transform_feedback3_lines_triangles GL_AMD_vertex_shader_tessellator GL_ARB_ES2_compatibility GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_indirect GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_stencil_export GL_ARB_shader_subroutine GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_tessellation_shader GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_compression GL_ARB_texture_compression_bptc GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_snorm GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_64bit GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_meminfo GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_buffer GL_EXT_copy_texture GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_histogram GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shader_image_load_store GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_bptc GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_vertex_attrib_64bit GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_explicit_multisample GL_NV_float_buffer GL_NV_half_float GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_barrier GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_swap_control
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: ATI Radeon HD 5700 Series
GL_ShadingLanguageVersion: 4.10
Looks like you've got a newer Intel chipset.GL_VERSION: 3.0.0 - Build 8.15.10.2353
Different hardware supports different version of OpenGL. Specifically: OpenGL 4.x has tessellation, random image write support and a number of other goodies. Intel GPU's do not have any of these capabilities, so regardless of how new the drivers are, that hardware does not have that ability, thus it cannot report GL 4.x. [As a side note, GeForce 8xxx, 9xxx, 1xx, 2xx and 3xx also cannot support GL 4.x, but their drivers are regularly updated by NVIDIA].I thought OpenGL will be updated automatically by Windows-Update, but i got no one?
My usual bet is that the Intel GPU and driver combination is what is causing your issues, but .... sometimes it pays to not jump the gun.
Check got GL errors (glGetError), if an error comes up, pinpoint what GL call(s) generate the error(s).
Also, check that your shaders successfully compiled and linked on the laptop.
hi,
first thanks for your answer.
I want to remember that i use OpenTK-GameWindow. In my Programm i dont get a error, dont know why, but when you install OpenTK, u will get the OpenTK-Sample Browser. In the Sample OpenGL->Picking, thats what i implemented and what cause my problem, i get always the Error "Error at Swapbuffers: InvalidEnum"
The source code of that Example is:
So the Error occure in the OnRenderFrame() when SwapBuffers() is called.Code :using System; using System.IO; using System.Drawing; using System.Diagnostics; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Input; using Examples.Shapes; namespace Examples.Tutorial { /// <summary> /// This demo shows over which triangle the cursor is, it does so by assigning all 3 vertices of a triangle the same Ids. /// Each Id is a uint, split into 4 bytes and used as triangle color. In an extra pass, the screen is cleared to uint.MaxValue, /// and then the mesh is drawn using color. Using GL.ReadPixels() the value under the mouse cursor is read and can be converted. /// </summary> [Example("Picking", ExampleCategory.OpenGL, "1.x", Documentation = "Picking")] class Picking : GameWindow { /// <summary>Creates a 800x600 window with the specified title.</summary> public Picking() : base(800, 600, GraphicsMode.Default, "Picking", GameWindowFlags.Default, DisplayDevice.Default, 1, 1, GraphicsContextFlags.Default) { VSync = VSyncMode.On; } struct Byte4 { public byte R, G, B, A; public Byte4(byte[] input) { R = input[0]; G = input[1]; B = input[2]; A = input[3]; } public uint ToUInt32() { byte[] temp = new byte[] { this.R, this.G, this.B, this.A }; return BitConverter.ToUInt32(temp, 0); } public override string ToString() { return this.R + ", " + this.G + ", " + this.B + ", " + this.A; } } struct Vertex { public Byte4 Color; // 4 bytes public Vector3 Position; // 12 bytes public const byte SizeInBytes = 16; } const TextureTarget Target = TextureTarget.TextureRectangleArb; float angle; BeginMode VBO_PrimMode; Vertex[] VBO_Array; uint VBO_Handle; uint SelectedTriangle; // int VertexShaderObject, FragmentShaderObject, ProgramObject; /// <summary>Load resources here.</summary> /// <param name="e">Not used.</param> protected override void OnLoad(EventArgs e) { GL.Enable(EnableCap.DepthTest); GL.Enable(EnableCap.CullFace); #region prepare data for VBO from procedural object DrawableShape temp_obj = new SierpinskiTetrahedron(3f, SierpinskiTetrahedron.eSubdivisions.Five, false); VertexT2fN3fV3f[] temp_VBO; uint[] temp_IBO; temp_obj.GetArraysforVBO(out VBO_PrimMode, out temp_VBO, out temp_IBO); temp_obj.Dispose(); if (temp_IBO != null) throw new Exception("Expected data for GL.DrawArrays, but Element Array is not null."); // Convert from temp mesh to final object, copy position and add triangle Ids for the color attribute. VBO_Array = new Vertex[temp_VBO.Length]; int TriangleCounter = -1; for (int i = 0; i < temp_VBO.Length; i++) { // Position VBO_Array[i].Position = temp_VBO[i].Position; // Index if (i % 3 == 0) TriangleCounter++; VBO_Array[i].Color = new Byte4(BitConverter.GetBytes(TriangleCounter)); } #endregion prepare data for VBO from procedural object #region Setup VBO for drawing GL.GenBuffers(1, out VBO_Handle); GL.BindBuffer(BufferTarget.ArrayBuffer, VBO_Handle); GL.BufferData<Vertex>(BufferTarget.ArrayBuffer, (IntPtr)(VBO_Array.Length * Vertex.SizeInBytes), VBO_Array, BufferUsageHint.StaticDraw); GL.InterleavedArrays(InterleavedArrayFormat.C4ubV3f, 0, IntPtr.Zero); ErrorCode err = GL.GetError(); if (err != ErrorCode.NoError) Trace.WriteLine("VBO Setup failed (Error: " + err + "). Attempting to continue."); #endregion Setup VBO for drawing #region Shader /* // Load&Compile Vertex Shader using (StreamReader sr = new StreamReader("Data/Shaders/Picking_VS.glsl")) { VertexShaderObject = GL.CreateShader(ShaderType.VertexShader); GL.ShaderSource(VertexShaderObject, sr.ReadToEnd()); GL.CompileShader(VertexShaderObject); } err = GL.GetError(); if (err != ErrorCode.NoError) Trace.WriteLine("Vertex Shader: " + err); string LogInfo; GL.GetShaderInfoLog(VertexShaderObject, out LogInfo); if (LogInfo.Length > 0 && !LogInfo.Contains("hardware")) Trace.WriteLine("Vertex Shader failed!\nLog:\n" + LogInfo); else Trace.WriteLine("Vertex Shader compiled without complaint."); // Load&Compile Fragment Shader using (StreamReader sr = new StreamReader("Data/Shaders/Picking_FS.glsl")) { FragmentShaderObject = GL.CreateShader(ShaderType.FragmentShader); GL.ShaderSource(FragmentShaderObject, sr.ReadToEnd()); GL.CompileShader(FragmentShaderObject); } GL.GetShaderInfoLog(FragmentShaderObject, out LogInfo); err = GL.GetError(); if (err != ErrorCode.NoError) Trace.WriteLine("Fragment Shader: " + err); if (LogInfo.Length > 0 && !LogInfo.Contains("hardware")) Trace.WriteLine("Fragment Shader failed!\nLog:\n" + LogInfo); else Trace.WriteLine("Fragment Shader compiled without complaint."); // Link the Shaders to a usable Program ProgramObject = GL.CreateProgram(); GL.AttachShader(ProgramObject, VertexShaderObject); GL.AttachShader(ProgramObject, FragmentShaderObject); // link it all together GL.LinkProgram(ProgramObject); err = GL.GetError(); if (err != ErrorCode.NoError) Trace.WriteLine("LinkProgram: " + err); GL.UseProgram(ProgramObject); err = GL.GetError(); if (err != ErrorCode.NoError) Trace.WriteLine("UseProgram: " + err); // flag ShaderObjects for delete when not used anymore GL.DeleteShader(VertexShaderObject); GL.DeleteShader(FragmentShaderObject); int temp; GL.GetProgram(ProgramObject, ProgramParameter.LinkStatus, out temp); Trace.WriteLine("Linking Program (" + ProgramObject + ") " + ((temp == 1) ? "succeeded." : "FAILED!")); if (temp != 1) { GL.GetProgramInfoLog(ProgramObject, out LogInfo); Trace.WriteLine("Program Log:\n" + LogInfo); } Trace.WriteLine("End of Shader build. GL Error: " + GL.GetError()); GL.UseProgram(0); */ #endregion Shader } protected override void OnUnload(EventArgs e) { GL.BindBuffer(BufferTarget.ArrayBuffer, 0); GL.DeleteBuffers(1, ref VBO_Handle); base.OnUnload(e); } /// <summary> /// Called when your window is resized. Set your viewport here. It is also /// a good place to set up your projection matrix (which probably changes /// along when the aspect ratio of your window). /// </summary> /// <param name="e">Contains information on the new Width and Size of the GameWindow.</param> protected override void OnResize(EventArgs e) { GL.Viewport(ClientRectangle); Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView(MathHelper.PiOver4, this.Width / (float)this.Height, 0.1f, 10.0f); GL.MatrixMode(MatrixMode.Projection); GL.LoadMatrix(ref projection); } /// <summary> /// Called when it is time to setup the next frame. Add you game logic here. /// </summary> /// <param name="e">Contains timing information for framerate independent logic.</param> protected override void OnUpdateFrame(FrameEventArgs e) { if (Keyboard[Key.Escape]) Exit(); } /// <summary> /// Called when it is time to render the next frame. Add your rendering code here. /// </summary> /// <param name="e">Contains timing information.</param> protected override void OnRenderFrame(FrameEventArgs e) { GL.Color3(Color.White); GL.Enable(EnableCap.ColorArray); #region Pass 1: Draw Object and pick Triangle GL.ClearColor(1f, 1f, 1f, 1f); // clears to uint.MaxValue GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); Matrix4 modelview = Matrix4.LookAt(Vector3.UnitZ, Vector3.Zero, Vector3.UnitY); GL.MatrixMode(MatrixMode.Modelview); GL.LoadMatrix(ref modelview); GL.Translate(0f, 0f, -3f); GL.Rotate(angle, Vector3.UnitX); GL.Rotate(angle, Vector3.UnitY); angle += (float)e.Time * 3.0f; // You may re-enable the shader, but it works perfectly without and will run on intel HW too // GL.UseProgram(ProgramObject); GL.DrawArrays(VBO_PrimMode, 0, VBO_Array.Length); // GL.UseProgram(0); // Read Pixel under mouse cursor Byte4 Pixel = new Byte4(); GL.ReadPixels(Mouse.X, this.Height - Mouse.Y, 1, 1, PixelFormat.Rgba, PixelType.UnsignedByte, ref Pixel); SelectedTriangle = Pixel.ToUInt32(); #endregion Pass 1: Draw Object and pick Triangle GL.Color3(Color.White); GL.Disable(EnableCap.ColorArray); #region Pass 2: Draw Shape if (SelectedTriangle == uint.MaxValue) GL.ClearColor(.2f, .1f, .3f, 1f); // purple else GL.ClearColor(0f, .2f, .3f, 1f); // cyan GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.Color3(1f, 1f, 1f); GL.DrawArrays(VBO_PrimMode, 0, VBO_Array.Length); GL.PolygonMode(MaterialFace.Front, PolygonMode.Line); GL.Color3(Color.Red); GL.DrawArrays(VBO_PrimMode, 0, VBO_Array.Length); GL.PolygonMode(MaterialFace.Front, PolygonMode.Fill); if (SelectedTriangle != uint.MaxValue) { GL.Disable(EnableCap.DepthTest); GL.Color3(Color.Green); GL.DrawArrays(VBO_PrimMode, (int)SelectedTriangle * 3, 3); GL.Enable(EnableCap.DepthTest); } #endregion Pass 2: Draw Shape this.SwapBuffers(); ErrorCode err = GL.GetError(); if (err != ErrorCode.NoError) Trace.WriteLine("Error at Swapbuffers: " + err); } /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { // The 'using' idiom guarantees proper resource cleanup. // We request 30 UpdateFrame events per second, and unlimited // RenderFrame events (as fast as the computer can handle). using (Picking example = new Picking()) { // Get the title and category of this example using reflection. ExampleAttribute info = ((ExampleAttribute)example.GetType().GetCustomAttributes(false)[0]); example.Title = String.Format("OpenTK | {0} {1}: {2} (use the mouse to pick)", info.Category, info.Difficulty, info.Title); example.Run(30.0); } } } }
As u can see the Shader is commented and not used, so i dont use it, too. Because im a beginner in OpenGL-Programming. Could it be that thats the problem?