Posted Sunday, 24 July, 2011 - 21:45 by the Fiddler
You mean when using the "Microsoft GDI" renderer? AFAIK, that one has graphical glitches that are not possible to fix. Try using the Mesa3d renderer instead - it's faster, has higher quality and supports GL2.1 (i.e. shaders, VBOs, etc).
Posted Monday, 25 July, 2011 - 04:19 by the Fiddler
Your code looks correct. OpenTK sends your commands directly to the OpenGL driver, which handles all drawing. OpenTK doesn't draw anything itself - the artifacts you are seeing are caused by the driver.
Check what GL.GetString(StringName.Vendor) returns. If it says "Microsoft" or "Microsoft GDI" then you won't be able to avoid artifacts, unless you install a different OpenGL driver. (Check the website of your computer vendor or use Mesa3d from my previous post).
Posted Wednesday, 14 September, 2011 - 03:51 by Micropro
i used this code in Module when i working in visual basic and the program working without any error
Imports Tao.OpenGl
Imports Tao.Platform.Windows
Module OpenGL
Private Declare Sub ZeroMemory Lib "kernel32.dll" Alias "RtlZeroMemory"(ByVal Destination As Gdi.PIXELFORMATDESCRIPTOR, ByVal Length As Integer)
Dim hRC As System.IntPtr
Public Sub EnableOpenGL(ByVal ghDC As System.IntPtr)
Dim pfd As Gdi.PIXELFORMATDESCRIPTOR
Dim PixelFormat As Integer
ZeroMemory(pfd, Len(pfd))
pfd.Size = Len(pfd)
pfd.Version = 1
pfd.Flags = Gdi.PFD_DRAW_TO_WINDOW Or Gdi.PFD_SUPPORT_OPENGL Or Gdi.PFD_DOUBLEBUFFER
pfd.PixelType = Gdi.PFD_TYPE_RGBA
pfd.ColorBits = 32
pfd.DepthBits = 32
pfd.StencilBits = 32
pfd.LayerType = Gdi.PFD_MAIN_PLANE
PixelFormat = Gdi.ChoosePixelFormat(ghDC, pfd)
If PixelFormat = 0 Then
MessageBox.Show("Unable to retrieve pixel format")
End
End If
If Not (Gdi.SetPixelFormat(ghDC, PixelFormat, pfd)) Then
MessageBox.Show("Unable to set pixel format")
End
End If
hRC = Wgl.wglCreateContext(ghDC)
If hRC.ToInt32 = 0 Then
MessageBox.Show("Unable to get rendering context")
End
End If
If Not (Wgl.wglMakeCurrent(ghDC, hRC)) Then
MessageBox.Show("Unable to make rendering context current")
End
End If
End Sub
Sub DisableOpenGL()Wgl.wglMakeCurrent(IntPtr.Zero, IntPtr.Zero)Wgl.wglDeleteContext(hRC)
End Sub
End Module
but i have a problem to convert this code to c# code
Posted Thursday, 27 October, 2011 - 12:15 by the Fiddler
Three solutions:
Try selecting a different GraphicsMode.
Use the superior Mesa3d software renderer (it's free!).
Use a hardware accelerated OpenGL driver.
This is a well-known issue with Microsoft's OpenGL emulator. There's nothing OpenTK can do about it, but selecting a different GraphicsMode may help (it's possible that Tao was selecting a different mode than OpenTK).
Comments
Re: error when draw enything without vga driver
You mean when using the "Microsoft GDI" renderer? AFAIK, that one has graphical glitches that are not possible to fix. Try using the Mesa3d renderer instead - it's faster, has higher quality and supports GL2.1 (i.e. shaders, VBOs, etc).
Re: error when draw enything without vga driver
no the code that i used is opentk code to draw quads
Re: error when draw enything without vga driver
Your code looks correct. OpenTK sends your commands directly to the OpenGL driver, which handles all drawing. OpenTK doesn't draw anything itself - the artifacts you are seeing are caused by the driver.
Check what
GL.GetString(StringName.Vendor)returns. If it says "Microsoft" or "Microsoft GDI" then you won't be able to avoid artifacts, unless you install a different OpenGL driver. (Check the website of your computer vendor or use Mesa3d from my previous post).Re: error when draw enything without vga driver
up
Re: error when draw enything without vga driver
i used this code in Module when i working in visual basic and the program working without any error
but i have a problem to convert this code to c# code
Re: error when draw enything without vga driver
Can you please try the latest version from trunk? There is a slight chance that this issue might be visible only on specific pixel formats.
Re: error when draw enything without vga driver
please any one help me my program is Collapse
i was work on my graphic program about 2 years
this problem make my program Collapse
this problem does not esist when i work on vb.net and tao
when i work on c# and tao and opentk this problem is show
please any one tell me the solution..............
Re: error when draw enything without vga driver
Could be a bug in your program.
Re: error when draw enything without vga driver
Three solutions:
This is a well-known issue with Microsoft's OpenGL emulator. There's nothing OpenTK can do about it, but selecting a different GraphicsMode may help (it's possible that Tao was selecting a different mode than OpenTK).