Author Topic: ORDLL64.dll  (Read 7017 times)

0 Members and 4 Guests are viewing this topic.

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #30 on: February 29, 2020, 11:06:01 AM »
That would break too much of the existing code, and the background shader animations won't work anymore.
It is like to return 10 years ago, restoring the code from the first release that won't work with the new materials.

On Windows 10, the use of GLSL is a mandatory with the modern internet browsers.
This is the reason why IE8 has been deprecated and replaced by Edge :(



Charles Pegge

  • Guest
Re: ORDLL64.dll
« Reply #31 on: March 01, 2020, 04:34:00 AM »
My HP Pavilion notebook (2016) has no problems running WebGl

I came accross this cube-mapping demo:

https://webglsamples.org/dynamic-cubemap/dynamic-cubemap.html

and a water demo:

http://madebyevan.com/webgl-water/


« Last Edit: March 01, 2020, 04:41:16 AM by Charles Pegge »

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #32 on: March 01, 2020, 05:38:48 AM »
Charles

What doesn't work by you is GLSL not WebGL.

Can you play this
https://www.shadertoy.com/view/4sXBRn

If it works, then try it with Internet Explorer and Chrome and see the difference.

If you want i can send you the whole shader code processed by the GPU, to see if you can let it run on your config.
« Last Edit: March 01, 2020, 05:47:47 AM by Patrice Terrier »

Charles Pegge

  • Guest
Re: ORDLL64.dll
« Reply #33 on: March 01, 2020, 07:58:32 AM »
Thanks Patrice,

Works smoothly with MSEdge, Firefox and Chrome, but not Explorer.

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #34 on: March 01, 2020, 10:26:29 AM »
Charles

TRY WITH THE ATTACHED DLL, and let me know if it works by you.
I have disabled the GL_OES extension.

Charles Pegge

  • Guest
Re: ORDLL64.dll
« Reply #35 on: March 01, 2020, 01:45:02 PM »
It works!

But how should it be set up in a proper window app (in C) ?

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #36 on: March 01, 2020, 02:02:54 PM »
You must have the 2 folders OrResource and 3D_models into the same directory than the EXE and the ORDLL64.dll
Just like for the WinDev project here:
http://www.objreader.com/download/demo/OR17.7z

This one is provided with several 3D examples.

For now you can use drag & drop of 3D model onto the OpenGL display
Try with:
Dragster Engine
Nefertiti
Robots2
Star Surfer
Welcome


Note: you must have also Bass.dll, GDImage64.dll, and ORDLL64.dll into the same folder

And to better figure what it can do, run the WinDev project named OR17.exe (from the EXE folder)

Try also with the static shader Luminescence, that you must put inside of the 3D_models folder.
http://www.objreader.com/download/demo/Luminescence.zip

Better to post your questions from my forum, because you can download large attachments, that are impossible to use here, because of the small size limitation.
« Last Edit: March 01, 2020, 02:39:21 PM by Patrice Terrier »

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #37 on: March 01, 2020, 02:37:46 PM »
I forget to say that of course you must use the ORDLL64_Charles.zip version 😊

Charles Pegge

  • Guest
Re: ORDLL64.dll
« Reply #38 on: March 01, 2020, 03:18:39 PM »
Thanks Patrice,

I've now got it workinging properly as a child window with a main parent window.

Code: [Select]

  $filename "test2.exe"
  uses RTL64
  uses corewin
  uses OR64


  dim cmdline as asciiz ptr, hinst as sys
  @cmdline=GetCommandLine
  hinst=GetModuleHandle 0
  '


 Function WinMain(sys hinst, prevInst, asciiz*cmdline, sys show) as sys
  '=====================================================================


  WndClass wc
  MSG      wm

  sys hwnd, chwnd

  wc.style = CS_HREDRAW or CS_VREDRAW
  wc.lpfnWndProc = @WndProc
  wc.cbClsExtra = 0
  wc.cbWndExtra = 0   
  wc.hInstance = hinst
  wc.hIcon=LoadIcon 0, IDI_APPLICATION
  wc.hCursor=LoadCursor 0,IDC_ARROW
  wc.hbrBackground = GetStockObject WHITE_BRUSH
  wc.lpszMenuName =null
  wc.lpszClassName = strptr "Demo"

  RegisterClass (@wc)

 
  int Wwd = 800 , Wht = 640
 
  hwnd = CreateWindowEx 0,wc.lpszClassName,"ObjectViewer using OxygenBasic",WS_OVERLAPPEDWINDOW,0,0,Wwd,Wht,0,0,hinst,0
  'OR_CreateWindow(IN dword dwExStyle, IN HWND hParent, IN dword dwStyle, IN long x, IN long y, IN long w, IN long h, IN HMENU CtrlID)
  chwnd=OR_CreateWindow(0, hwnd, WS_POPUP, 100,100,640,480, 0)

  ShowWindow hwnd,SW_SHOW
  UpdateWindow hwnd
  ShowWindow chwnd,SW_SHOW
 '
  print OR_version() cr OR_About() cr OR_GPUinfo()

  sys bRet
  '
  do while bRet := GetMessage (@wm, 0, 0, 0)
    if bRet = -1 then
      'show an error message
    else
      TranslateMessage @wm
      DispatchMessage @wm
    end if
  wend

  End Function



  function WndProc ( sys hWnd, wMsg, wParam, lparam ) as sys callback
  '==================================================================

    select wMsg
       
       case WM_DESTROY
         
         PostQuitMessage 0

       case else

        function=DefWindowProc hWnd,wMsg,wParam,lParam

     end select
       
  end function ' WndProc

  WinMain hinst,0,cmdline,SW_NORMAL
 
« Last Edit: March 01, 2020, 03:30:36 PM by Charles Pegge »

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #39 on: March 01, 2020, 10:22:51 PM »
Charles

Yes, that seems to work fine.

I shall convert the WinDev demo to a C/C++ project, to help you better figure how to use the API wit O2.

But first thing, here are the default CreateWindow styles being used in OR_CreateWindow

Code: [Select]
HWND OR_CreateWindow (IN DWORD dwExStyle, IN HWND hParent, IN DWORD dwStyle, IN long x, IN long y, IN long w, IN long h, IN HMENU CtrlID) { // dllexport AS LONG
    if (dwStyle == 0) dwStyle = WS_POPUP;
    if (dwExStyle == 0) dwExStyle = WS_EX_TOOLWINDOW | WS_EX_ACCEPTFILES;

    gP.hGL = 0;
    WNDCLASSEX wcx = { 0 };
    WCHAR zClass[] = L"ORWavefront64";
    WCHAR zPath[MAX_PATH] = { 0 };
    HINSTANCE hInstance = GetModuleHandle(NULL);

    wcx.cbSize = sizeof(wcx);
    long IsInitialized = GetClassInfoEx(hInstance, zClass, &wcx);
    if (!IsInitialized) {
        wcx.style = CS_OWNDC | CS_DBLCLKS;
        wcx.lpfnWndProc = gl_WndProc;
        wcx.cbClsExtra = 0;
        wcx.cbWndExtra = 0;
        wcx.hInstance = hInstance;
        wcx.hIcon = NULL;
        wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
        wcx.hbrBackground = NULL;
        wcx.lpszMenuName = NULL;
        wcx.lpszClassName = zClass;
        wcx.hIconSm = NULL;
        if (RegisterClassEx(&wcx)) { IsInitialized = -1; }
    }
    if (IsInitialized) {
        gP.hGL = CreateWindowEx(dwExStyle, zClass, NULL, dwStyle, x, y, w, h, hParent, (HMENU)CtrlID, hInstance, NULL);
        if (IsWindow(gP.hGL)) {

            CreateSyncThread();

Note the use of WS_EX_TOOLWINDOW that allows you to easily switch the OpenGL view port to full screen mode.
But you can also use the WS_CHILD style rather than WS_POPUP, to let it work as a regular child control, and anchor the control to match the parent window size, you can do the same in toolwindow mode, processing the WM_SIZE/WM_MOVE/MAXIMIZE/RESTORE messages.

Inside the control you can use the left mouse button to rotate the model, the right mouse button to pan up/down/left/right, and the mouse wheel for magnification.

You can use drag-and-drop of either a "3D model folder", or a "3Dmodel.obj" file, or any audio file and see the processing of the audio signal with models that have been designed to use it (sync mode), or just hear audio.
« Last Edit: March 02, 2020, 12:45:04 AM by Patrice Terrier »

Arnold

  • Guest
Re: ORDLL64.dll
« Reply #40 on: March 02, 2020, 12:15:36 AM »
Hi Charles,

your test2.exe runs well with my system (apart from Patrice's notification) using both versions of ORDLL64.dll. Dragging the .obj models and applying the mouse buttons work as expected. Using version 0.2.8, I was also able to compile test2.o2bas to the exe file. ORDLL64.dll and Oxygenbasic seem to work very well together. This is really cool.

Roland

« Last Edit: March 02, 2020, 04:35:49 AM by Arnold »

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #41 on: March 02, 2020, 07:14:53 AM »
Charles,

I am writing the C++ template (with VS 2019), however no bells and whistles for now, just plain lean Windows controls...

Charles Pegge

  • Guest
Re: ORDLL64.dll
« Reply #42 on: March 02, 2020, 08:00:33 AM »
Thanks Patrice,

I hope this is a good investment of your time for potential 'C' users of ObjReader.

Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #43 on: March 02, 2020, 01:47:43 PM »
Charles

Here is the first shot...

Put ORV64.exe into the same folder than the DLL(s) with the extra resource folders.

The C++ code has been written with Visual Studio 2019 (the free community version).


Patrice Terrier

  • Guest
Re: ORDLL64.dll
« Reply #44 on: March 02, 2020, 02:37:16 PM »
#define IDC_VERTICES            15
#define IDC_TRIANGLES           16
#define IDC_MESHES              17
#define IDC_MATERIALS           18
#define IDC_INDICES             18
#define IDC_OBJSIZE             20
#define IDC_LOADTIME            21


it should be 19, not 18