January 26, 2021, 12:24:35 PM

Author Topic: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]  (Read 949 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« on: June 29, 2017, 12:28:43 AM »
Title : wxMax + minib3d
Author : Warner
Posted : 1+ years ago

Description : Not sure if this is the best way to do this, but this is how I got this to work.

Code :
Code: BlitzMax
  1. SuperStrict
  2.  
  3. Framework wx.wxApp
  4. Import wx.wxFrame
  5. Import wx.wxPanel
  6. Import wx.wxGLCanvas
  7. Import wx.wxglmax2D
  8.  
  9. Import wx.wxTimer
  10.  
  11. Import sidesign.minib3d
  12.  
  13. 'Since i want to call 'refresh' from inside the timer, i need to store
  14. 'this handle. That way i can address 'prog.canvas'
  15. Global prog:MyApp = New MyApp
  16. prog.Run()
  17.  
  18. Type MyApp Extends wxApp
  19.  
  20.         Field frame:wxFrame
  21.         Field panel:wxPanel
  22.         Field canvas:TMiniB3D
  23.  
  24.         Method OnInit:Int()
  25.  
  26.                 'create a 640x480 window
  27.                 frame = New wxFrame.Create(,,"MiniB3d Sample", 0, 0, 640, 480)
  28.                 frame.Center()
  29.                
  30.                 'create a 320x240 wxPanel
  31.                 panel = New wxPanel.Create(frame, wxID_ANY, 160, 0, 320, 240)
  32.                 'create wxGLCanvas with minib3d on it
  33.                 canvas = TMiniB3D(New TMiniB3D.Create(panel, wxID_ANY, GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER, 0, 0, 320, 240))
  34.  
  35.                 'create timer
  36.                 Local timer:wxTimer = MyTimer(New MyTimer.Create())
  37.                 timer.Start(25)
  38.                                                                
  39.                 frame.show()                           
  40.  
  41.                 Return True
  42.        
  43.         End Method
  44.                        
  45. End Type
  46.  
  47. Type TMiniB3D Extends wxGLCanvas
  48.  
  49.         Field init:Int = 0
  50.                                
  51.         Method OnPaint(event:wxPaintEvent)
  52.        
  53.                 'this could be done better, i'm sure, but for me it was the only way it works
  54.                 'when onpaint is called, the canvas is valid and can be initialized by minib3d
  55.                 If init = 0 Then
  56.                
  57.                         'init minib3d
  58.                         SetGraphics CanvasGraphics2D( Self )
  59.                         TGlobal.width = 320
  60.                         TGlobal.height = 240
  61.                         TGlobal.depth = 32
  62.                         TGlobal.mode = 2
  63.                         TGlobal.GraphicsInit()
  64.                         init = 1
  65.  
  66.                         'function for creating camera's etc.                   
  67.                         InitMB3D()
  68.                        
  69.                 End If
  70.  
  71.                 'after that, every time onpaint is called, the scene can be rendered
  72.                 RenderMB3D()
  73.  
  74.         End Method
  75.  
  76. End Type
  77.  
  78. Global cam:TCamera
  79. Global cube:TEntity
  80.  
  81. 'setup camera and cube
  82. Function InitMB3D()
  83.  
  84.         cam  = CreateCamera()
  85.         cube = CreateCube()
  86.         MoveEntity cam, 0, 0, -5
  87.        
  88.         EntityTexture cube, LoadTexture("C:Program FilesBlitzMaxdocshtmlmax120.png") 'hopefully you have this file too
  89.         EntityFX cube, 1
  90.        
  91.         RenderWorld 'i need to do this in my modded version of minib3d, i don't think it is needed in the orig. version
  92.  
  93. End Function
  94.  
  95. 'render stuff
  96. Function RenderMB3D()
  97.  
  98.         RenderWorld
  99.        
  100.         BeginMax2D 'max2d works as well
  101.         DrawText "hello", 0, 0
  102.         EndMax2D
  103.        
  104.         Flip
  105.  
  106. End Function
  107.  
  108. 'timer
  109. Type MyTimer Extends wxTimer
  110.  
  111.         Field count:Int
  112.  
  113.         Method Notify()
  114.                 TurnEntity cube, 1, 2, 3 'turn cube
  115.                 prog.canvas.Refresh() 'render scene
  116.         End Method
  117.  
  118. End Type


Comments : none...

Offline Hardcoal

  • Hero Member
  • *****
  • Posts: 540
  • nothing is personal
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #1 on: January 13, 2021, 09:49:19 PM »
Hi Im trying to build the WX modules of WXMax in blide.. and I get this error for example

►wx.wxframe was scheduled to next iteration
In file included from D:/PORTABLE/BlitzMax/mod/wx.mod/wxframe.mod/glue.h:24:0,
                 from D:/PORTABLE/BlitzMax/mod/wx.mod/wxframe.mod/glue.cpp:23:
D:/PORTABLE/BlitzMax/mod/wx.mod/wxframe.mod/../wxstatusbar.mod/glue.h:31:19: fatal error: blitz.h: No such file or directory
compilation terminated.
Build Error: failed to compile D:/PORTABLE/BlitzMax/mod/wx.mod/wxframe.mod/glue.cpp
►►►►wx.wxframe was not built. See error information on latest attempt.


Any Ideas?
Lets make the world a better place

Offline Henri

  • Sr. Member
  • ****
  • Posts: 293
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #2 on: January 13, 2021, 10:22:31 PM »
Where did you download wx.mod ?

What is the MinGW version you are using ?

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline Hardcoal

  • Hero Member
  • *****
  • Posts: 540
  • nothing is personal
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #3 on: January 13, 2021, 10:54:09 PM »
I downloaded it from brucey mods

https://libraries.io/github/maxmods

mingw version.. well how do i check it?

Im using blitzmax not blitzmax ng

Lets make the world a better place

Offline Henri

  • Sr. Member
  • ****
  • Posts: 293
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #4 on: January 13, 2021, 11:13:13 PM »
Quote
How do I check MinGW version..

Run cmd and type gcc -v

Here is a more direct link to https://github.com/maxmods/wx.mod . Press the green Code button to download wx in zip file.

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline Hardcoal

  • Hero Member
  • *****
  • Posts: 540
  • nothing is personal
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #5 on: January 14, 2021, 03:18:15 AM »
thanks henri . i did download it from there..

and the type gcc -v wrote me

C:\Users\Danny>type gcc -v
The system cannot find the file specified.
Error occurred while processing: gcc.
The system cannot find the file specified.
Error occurred while processing: -v.


[30 mins later update]

I downloaded the version from here https://code.google.com/archive/p/wxmax/downloads
and this one works..

[20 mins later again :)]

ok blide did built 187 files besides 3 that it didnt..
but now when i compile i get this type of errors

D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x15): undefined reference to `__gxx_personality_sj0'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0xb8): undefined reference to `_Unwind_SjLj_Unregister'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0xf5): undefined reference to `_Unwind_SjLj_Resume'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x137): undefined reference to `__gxx_personality_sj0'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x14a): undefined reference to `_Unwind_SjLj_Register'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x184): undefined reference to `_Unwind_SjLj_Unregister'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x1be): undefined reference to `_Unwind_SjLj_Resume'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x1f7): undefined reference to `__gxx_personality_sj0'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x20a): undefined reference to `_Unwind_SjLj_Register'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x244): undefined reference to `_Unwind_SjLj_Unregister'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x27e): undefined reference to `_Unwind_SjLj_Resume'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x2a2): undefined reference to `__gxx_personality_sj0'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x2c4): undefined reference to `_Unwind_SjLj_Register'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x389): undefined reference to `_Unwind_SjLj_Unregister'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x3ed): undefined reference to `_Unwind_SjLj_Resume'
D:/PORTABLE/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw28u_xrc.a(xrclib_xmlres.o):xmlres.cpp:(.text+0x5a7): undefined reference to `__gxx_personality_sj0'
Lets make the world a better place

Offline Henri

  • Sr. Member
  • ****
  • Posts: 293
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #6 on: January 14, 2021, 09:21:14 AM »

@gcc error

That means that MinGW bin dir was not in your Windows path system variable,
which leads me to believe that MinGW is not installed by you (legacy has inbuilt MinGW).


@Build error

MinGW has two versions of exception models: dwarf and silj. Legacy bmax has inbuilt MinGW (old gcc 3.xx or something) that has dwarf model.
Old version of wx found at Google code needs older version of MinGW with silj model exceptions.

Ng has silj model gcc 8.xx by default.

You could try different MinGW versions with this installer found here https://sourceforge.net/projects/mingw-w64/

Just use the 32-bit architecture (i686)

DISCLAIMER!
BEFORE DOING ANYTHING PLEASE BACKUP YOUR BMAX FOLDER!

Legacy bmax has a lib folder that contains all the libraries used to build modules. These are specific to MinGW version.
You have to build all the modules with the same version or there will be errors..

This whole MinGW testing would be lot easier if you downloaded the newest version of bmk at https://github.com/bmx-ng/bmk
By using this you don't need to replace the libraries in bmax lib folder for every MinGW change you want to test,
just rename the newly installed MinGW folder to MinGW32 and copy it to bmax folder and rebuild all modules.

Also,better to first compile default modules and test that they are working before trying to compile wx mod.

-Henri

- Got 01100011 problems, but the bit ain't 00000001

Offline Hardcoal

  • Hero Member
  • *****
  • Posts: 540
  • nothing is personal
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #7 on: January 14, 2021, 12:48:45 PM »
I downloaded the MinGw you offered.. so youre saying i only need to put it on the blitzmax folder?
no need installation?
than rebuild all modules?

also ive downloaded the bmk masters ..  but it needs compiling..
isnt there a compiled version made already?

sorry those things are beyond my knowledge.

anyway.. im experimenting and see what happen
Lets make the world a better place

Offline Henri

  • Sr. Member
  • ****
  • Posts: 293
Re: [bmx] wxMax + minib3d by Warner [ 1+ years ago ]
« Reply #8 on: January 14, 2021, 01:37:08 PM »
Just compile the bmk.bmx as console app and not as a gui app and in release mode. Optionally you can also enable threading.
And as the website instructions say copy the resulting bmk.exe, make.bmk, custom.bmk and core.bmk to your bmax bin folder (do not overwrite anything, just rename the original so they are safe)

After this you can install MinGW to <your_bmax_folder>/MinGW32 or MinGWx86 (as in 32-bit).

Then you can try to rebuild your modules..

-Henri
- Got 01100011 problems, but the bit ain't 00000001

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal