Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Je ne possède pas WD26 (j'ai uniquement WD17).
Sans voir le code que vous avez modifié, il est très difficile de vous répondre.

Concernant les sprites, vous devez les créer une fois pour toute (dans votre cas 5 sprites, toujours les mêmes).

Je ne pense pas que la version de Windev soit un enjeu...

Je crois bien créer les sprites mais je peux ou ne sais pas comment les afficher...

De Plus, lorsque je quitte je n'élimine pas les instances de la mémoire. Ce qui crée une surcharge de la mémoire et une erreur fatale après quelques répétition du cycle de lancer des dés.

J'inclus trois procédures :
   1- L'initialisation de la fenêtre et la destruction des instances: Win_GDImage.pdf
   2- Le lancer des dés avec la création des sprites: LancerLesDés.pdf
   3- La fonction de la création des dés: GDImageCreateSprite.pdf

Merci à l'avance
12
Bonsoir Patrice,

Je viens de découvrir hier qu'il y a moyen d'enregistrer la version "28-express" de WinDev gratuitement (comme privé). C'est limité à 32 bits, mais avec l'expérience que tu as avec WinDev, je pense que cela vaut la peine de regarder ce qui a changé.

Je voudrais te parler sérieusement d'un projet que j'envisage, mais pas ici. Je t'enverrai un mail privé ou un message privé.

À bientôt,
13
Je ne possède pas WD26 (j'ai uniquement WD17).
Sans voir le code que vous avez modifié, il est très difficile de vous répondre.

Concernant les sprites, vous devez les créer une fois pour toute (dans votre cas 5 sprites, toujours les mêmes).
14
Questions & Comments about GDImage / GDImage 64 bit sur une plateforme windev 26
« Last post by Michel Lauzon on December 16, 2024, 10:28:42 pm »
J'ai récupéré la DLL de GDImage et j'ai modifié l'exemple "The Cube" de Patrice Terrier... Pour la faire rouler sur une plateforme Windev 26 de PCSoft sur Windows 10...

Le but est de renforcer mon jeux de dés (Dix Milles) avec du graphisme qu'offre GDImage. Je dois donc faire rouler 5 dés sur un aire de jeu...

Partant de la routine THE CUBE, je réussis à faire le lancer de un dé... Dans mes procédures je réussis à lancer les 5 dés et recouvrir la face terminal pour pouvoir continuer le jeux mais toujours un seul dé roule sur la surface de jeu.

Ainsi je peux relancer les dés mais après un certain nombre de lancer, erreur fatal met un terme à l'application. Je n'arrive pas à ouvrir le DUMP de la mémoire pour voir ce qu'il se passe mais je me doute qu'il y a une surcharge de la mémoire n'étant pas capable de bien éliminer toutes les instances des SPRITES créer...

Je me heurte à ceci car je n'ai pas les connaissance pour bien manipuler les librairies de graphismes !!! J'aimerais bien trouver des documents pouvant me guider dans cette nouvelle aventure???

Essentiellement, de la routine originale j'ai modifié les procédures:
 1- La fin de l'initialisation de WIN_GDImage
 2- GDIamgeCreateSprite()
 3- RenderAnimation()
 En plus de rajouter l'interface des variables (GP) pour un tableau de 5 unités

J'imagine que ma requête est assez importante mais quelques piste de solutions et de bonnes documentations m'aiderait beaucoup...

Merci à l'avance

Michel Lauzon

15
The 3D Model Collection / Pagani Utopia
« Last post by Patrice Terrier on November 25, 2024, 05:44:31 pm »
Pagani Utopia

More than 400 hours work to create this beauty...



















If you download this model, please consider making a small donation to help me keep this forum alive, thank you!


16
Get ObjReader & Documentation / Full version 3.03
« Last post by Patrice Terrier on November 25, 2024, 10:25:19 am »
Full version 3.03

The new compressed .7z archive is attached to the first post of this thread.

When saving a screen shot, the explorer dialog box was never closing after the image was saved.
This bug mainly occured with Windows 11, it has been fixed.

17
Tips & Tricks / Re: SDK Window including openGl
« Last post by Frank Brübach on November 14, 2024, 11:32:51 am »
Bonjour et merci beaucoup zu pour cette example .. thanks , Frank
18
Tips & Tricks / Re: SDK Window including openGl
« Last post by Patrice Terrier on November 13, 2024, 10:42:34 pm »
See the 3D Chart project written in PowerBASIC
http://www.objreader.com/index.php?topic=17.msg6291#msg6291

The same project is also avalable in C/C++ 64-bit for comparison purpose.
19
Tips & Tricks / Re: SDK Window including openGl
« Last post by Frank Brübach on November 13, 2024, 02:03:11 pm »
hello patrice thanks for your code example. but I have questions about some equates
%ZI_GLDC, %ZI_GLRC,%Extend_cbWndExtra, and $GLImageClassName
and ZI_GetProperty() function and ZI_SetProperty() function

do you have a running openGL 32-bit example for me for testing with needed equates and functions?

Code: [Select]
%ZI_GLDC = ?
%ZI_GLRC = ?
%Extend_cbWndExtra = ?

ZI_SetProperty() function ?
ZI_GetProperty() function ?

ZI_SetProperty(hWnd, %ZI_GLDC, glDC)
ZI_SetProperty(hWnd, %ZI_GLRC, glRC)

what is $GLImageClassName = ? '  "WGL_OpenGL" ???

FUNCTION ZI_GetProperty(BYVAL a AS DWORD, BYVAL b AS DWORD) EXPORT AS DWORD

    END FUNCTION

FUNCTION ZI_SetProperty(BYVAL a AS DWORD, BYVAL b AS DWORD,BYVAL c AS DWORD) EXPORT AS DWORD

END FUNCTION

FUNCTION InitMultisample(BYVAL a AS DWORD, BYVAL b AS LONG) EXPORT AS DWORD

    END FUNCTION

' update
FUNCTION WGL_CreateWindow ALIAS "WGL_CreateWindow" (BYVAL dwExStyle AS DWORD, _
                                                    BYVAL dwStyle AS DWORD, _
                                                    BYVAL x AS LONG, BYVAL y AS LONG, _
                                                    BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, _
                                                    BYVAL hWndParent AS DWORD, _
                                                    BYVAL CtrlID AS DWORD) EXPORT AS DWORD

    LOCAL IsInitialized, wcStyle, glDC, glRC AS LONG
    LOCAL hWnd, hTemp AS DWORD
    LOCAL wc     AS WndClassEx
    LOCAL zClass AS ASCIIZ * 16
    LOCAL GLImageClassName AS WSTRINGZ*180 ' $GLImageClassName

    '$GLImageClassName="WGL_OpenGL" ' ???

    LOCAL zInstance AS DWORD
    LOCAL gn_arbMultisampleFormat AS LONG

    zClass = "GL_CHARTCTRL"

    ' Create a temporary window for initializing OpenGL context
    hTemp = CreateWindowEx(dwExStyle, "", "", dwStyle, _ '$GLImageClassName ......... ???
                           0, 0, 0, 0, hWndParent, CtrlID, zInstance, BYVAL 0)
    IF hTemp THEN
       ' Get device context and rendering context properties from the temporary window
       glDC = ZI_GetProperty(hTemp, %ZI_GLDC)
       glRC = ZI_GetProperty(hTemp, %ZI_GLRC)

       LOCAL pfd AS PIXELFORMATDESCRIPTOR

       ' Set up the PIXELFORMATDESCRIPTOR structure
       pfd.nSize              = SIZEOF(pfd)
       pfd.nVersion           = 1
       pfd.dwFlags            = %PFD_DRAW_TO_WINDOW OR %PFD_SUPPORT_OPENGL OR %PFD_DOUBLEBUFFER OR %PFD_SUPPORT_GDI
       pfd.iPixelType         = 0 ' PFD_TYPE_RGBA
       pfd.cColorBits         = 32
       pfd.cRedBits           = 0
       pfd.cRedShift          = 0
       pfd.cGreenBits         = 0
       pfd.cGreenShift        = 0
       pfd.cBlueBits          = 0
       pfd.cBlueShift         = 0
       pfd.cAlphaBits         = 1
       pfd.cAlphaShift        = 0
       pfd.cAccumBits         = 0
       pfd.cAccumRedBits      = 0
       pfd.cAccumGreenBits    = 0
       pfd.cAccumBlueBits     = 0
       pfd.cAccumAlphaBits    = 0
       pfd.cDepthBits         = 24 ' Depth buffer
       pfd.cStencilBits       = 0
       pfd.cAuxBuffers        = 0
       pfd.iLayerType         = 0 ' %PFD_MAIN_PLANE
       pfd.bReserved          = 0
       pfd.dwLayerMask        = 0
       pfd.dwVisibleMask      = 0
       pfd.dwDamageMask       = 0

       ' Initialize multisampling
       InitMultisample(glDC, VARPTR(pfd)) ' ???

       IF gn_arbMultisampleFormat THEN
          ' Set up the window class for the OpenGL control
          wcStyle = %CS_HREDRAW OR %CS_VREDRAW OR %CS_DBLCLKS OR %CS_OWNDC
          wc.cbSize = SIZEOF(wc)
          IsInitialized = GetClassInfoEx(zInstance, zClass, wc)
          IF IsInitialized = 0 THEN
             wc.cbSize        = SIZEOF(wc)
             wc.style         = wcStyle
             wc.lpfnWndProc   = CODEPTR(GL_WindowProc)
             wc.cbClsExtra    = 0
             wc.cbWndExtra    = %Extend_cbWndExtra * 4
             wc.hInstance     = zInstance
             wc.hIcon         = %NULL
             wc.hCursor       = LoadCursor(%NULL, BYVAL %IDC_ARROW)
             wc.hbrBackground = %NULL ' Don't paint the class window background
             wc.lpszMenuName  = %NULL
             wc.lpszClassName = VARPTR(zClass)
             wc.hIconSm       = %NULL
             IF RegisterClassEx(wc) THEN IsInitialized = %TRUE
          END IF

          IF IsInitialized THEN
             ' Create the OpenGL control window
             hWnd = CreateWindowEx(dwExStyle, _
                                   zClass, _         ' Make it an OpenGL control
                                   "", _             ' Currently not used
                                   dwStyle, _        ' window style
                                   x, _              ' initial x position
                                   y, _              ' initial y position
                                   nWidth, _         ' Calculate Window Width
                                   nHeight, _        ' Calculate Window Height
                                   hWndParent, _     ' parent window handle
                                   CtrlID, _         ' ControlID
                                   zInstance, _    ' program instance handle
                                   BYVAL 0)          ' creation parameters
             IF hWnd THEN
                ' Get device context and set pixel format
                glDC = GetDC(hWnd)
                IF SetPixelFormat(glDC, gn_arbMultisampleFormat, pfd) THEN
                   ' Destroy the temporary window and create the OpenGL context
                   DestroyWindow(hTemp)
                   glRC = wglCreateContext(glDC)
                   wglMakeCurrent(glDC, glRC)
                   ZI_SetProperty(hWnd, %ZI_GLDC, glDC)
                   ZI_SetProperty(hWnd, %ZI_GLRC, glRC)
                ELSE
                   ' Fallback: use the temporary window
                   DestroyWindow(hWnd)
                   MoveWindow(hTemp, x, y, nWidth, nHeight, 0)
                   hWnd = hTemp
                END IF
             END IF

          END IF
       ELSE
          ' Fallback: use the temporary window
          MoveWindow(hTemp, x, y, nWidth, nHeight, 0)
          hWnd = hTemp
       END IF
    END IF
    FUNCTION = hWnd
END FUNCTION



20
Tips & Tricks / Re: SDK Window including openGl
« Last post by Patrice Terrier on November 13, 2024, 09:06:25 am »
The easiest way, is to use the GDImage WGL_CreateWindow API that is available in both 32 and 64-bit.
It takes care of all the complex PIXELFORMATDESCRIPTOR details, and moreover GDImage has advanced texture support.

Here is the GDImage code for WGL_CreateWindow

Code: [Select]
FUNCTION WGL_CreateWindow ALIAS "WGL_CreateWindow" (BYVAL dwExStyle AS DWORD, _
                                                    BYVAL dwStyle AS DWORD, _
                                                    BYVAL x AS LONG, BYVAL y AS LONG, _
                                                    BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, _
                                                    BYVAL hWndParent AS DWORD, _
                                                    BYVAL CtrlID AS DWORD) EXPORT AS DWORD

    LOCAL IsInitialized, wcStyle, glDC, glRC AS LONG
    LOCAL hWnd, hTemp AS DWORD
    LOCAL wc     AS WndClassEx
    LOCAL zClass AS ASCIIZ * 16
    zClass = "GL_CHARTCTRL"

    ' Create a temporary window for initializing OpenGL context
    hTemp = CreateWindowEx(dwExStyle, $GLImageClassName, "", dwStyle, _
                           0, 0, 0, 0, hWndParent, CtrlID, zInstance(), BYVAL 0)
    IF hTemp THEN
       ' Get device context and rendering context properties from the temporary window
       glDC = ZI_GetProperty(hTemp, %ZI_GLDC)
       glRC = ZI_GetProperty(hTemp, %ZI_GLRC)

       LOCAL pfd AS PIXELFORMATDESCRIPTOR

       ' Set up the PIXELFORMATDESCRIPTOR structure
       pfd.nSize              = SIZEOF(pfd)
       pfd.nVersion           = 1
       pfd.dwFlags            = %PFD_DRAW_TO_WINDOW OR %PFD_SUPPORT_OPENGL OR %PFD_DOUBLEBUFFER OR %PFD_SUPPORT_GDI
       pfd.iPixelType         = 0 ' PFD_TYPE_RGBA
       pfd.cColorBits         = 32
       pfd.cRedBits           = 0
       pfd.cRedShift          = 0
       pfd.cGreenBits         = 0
       pfd.cGreenShift        = 0
       pfd.cBlueBits          = 0
       pfd.cBlueShift         = 0
       pfd.cAlphaBits         = 1
       pfd.cAlphaShift        = 0
       pfd.cAccumBits         = 0
       pfd.cAccumRedBits      = 0
       pfd.cAccumGreenBits    = 0
       pfd.cAccumBlueBits     = 0
       pfd.cAccumAlphaBits    = 0
       pfd.cDepthBits         = 24 ' Depth buffer
       pfd.cStencilBits       = 0
       pfd.cAuxBuffers        = 0
       pfd.iLayerType         = 0 ' %PFD_MAIN_PLANE
       pfd.bReserved          = 0
       pfd.dwLayerMask        = 0
       pfd.dwVisibleMask      = 0
       pfd.dwDamageMask       = 0

       ' Initialize multisampling
       InitMultisample(glDC, pfd)

       IF gn_arbMultisampleFormat THEN
          ' Set up the window class for the OpenGL control
          wcStyle = %CS_HREDRAW OR %CS_VREDRAW OR %CS_DBLCLKS OR %CS_OWNDC
          wc.cbSize = SIZEOF(wc)
          IsInitialized = GetClassInfoEx(zInstance(), zClass, wc)
          IF IsInitialized = 0 THEN
             wc.cbSize        = SIZEOF(wc)
             wc.style         = wcStyle
             wc.lpfnWndProc   = CODEPTR(GL_WindowProc)
             wc.cbClsExtra    = 0
             wc.cbWndExtra    = %Extend_cbWndExtra * 4
             wc.hInstance     = zInstance()
             wc.hIcon         = %NULL
             wc.hCursor       = LoadCursor(%NULL, BYVAL %IDC_ARROW)
             wc.hbrBackground = %NULL ' Don't paint the class window background
             wc.lpszMenuName  = %NULL
             wc.lpszClassName = VARPTR(zClass)
             wc.hIconSm       = %NULL
             IF RegisterClassEx(wc) THEN IsInitialized = %TRUE
          END IF

          IF IsInitialized THEN
             ' Create the OpenGL control window
             hWnd = CreateWindowEx(dwExStyle, _
                                   zClass, _         ' Make it an OpenGL control
                                   "", _             ' Currently not used
                                   dwStyle, _        ' window style
                                   x, _              ' initial x position
                                   y, _              ' initial y position
                                   nWidth, _         ' Calculate Window Width
                                   nHeight, _        ' Calculate Window Height
                                   hWndParent, _     ' parent window handle
                                   CtrlID, _         ' ControlID
                                   zInstance(), _    ' program instance handle
                                   BYVAL 0)          ' creation parameters
             IF hWnd THEN
                ' Get device context and set pixel format
                glDC = GetDC(hWnd)
                IF SetPixelFormat(glDC, gn_arbMultisampleFormat, pfd) THEN
                   ' Destroy the temporary window and create the OpenGL context
                   DestroyWindow(hTemp)
                   glRC = wglCreateContext(glDC)
                   wglMakeCurrent(glDC, glRC)
                   ZI_SetProperty(hWnd, %ZI_GLDC, glDC)
                   ZI_SetProperty(hWnd, %ZI_GLRC, glRC)
                ELSE
                   ' Fallback: use the temporary window
                   DestroyWindow(hWnd)
                   MoveWindow(hTemp, x, y, nWidth, nHeight, 0)
                   hWnd = hTemp
                END IF
             END IF

          END IF
       ELSE
          ' Fallback: use the temporary window
          MoveWindow(hTemp, x, y, nWidth, nHeight, 0)
          hWnd = hTemp
       END IF
    END IF
    FUNCTION = hWnd
END FUNCTION
Pages: 1 [2] 3 4 ... 10