الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشكلة فى حالة عدم وجود تعريف الفيجا

بدأه EnigmaLine في 13 سبتمبر 2011 · 1 رد · 1,514 مشاهدة · في OpenGL
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم و رحمة الله و بركاته

حد عنده حل للمشكلة دى

post-239220-024069300 1315863207_thumb.p

طبعا الخط اللى فى النصف ده المفروض انه مش موجود و بيظهر فى كل شكل بترسم على الشاشة

المشكلة دى بتظهر لو تعريف الفيجا مش موجود حتى لو الويندوز معرف كارت الفيجا لوحده

انا استخدم C# And Opentk

المرفقات
1_1.png
#2

انا لما كنت بستخدم الفيجوال بيسك كنت يستعمل الكود ده فى المديول

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

وكان شغال تمام حتى لو تعريف الفيجا مش موجود المشكله اى مش عارف احول الكود ده للسى شارب او حتى اجيب الديل بتاعه

مواضيع مشابهة