PureBasic <> Python 2D/3D commands

Everything else that doesn't fall into one of the other PB categories.
marc_256
Addict
Addict
Posts: 862
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

PureBasic <> Python 2D/3D commands

Post by marc_256 »

I use PB to create a 2D/3D editor.
And I feel that since i use PB 5.21 there are some problems with mixed 2D and 3D stuff in one program.
The last one is some stuff with mouse movements in screen mode.
and the speed in 2D to draw stuff on the screen.

On the other side, I use blender to edit and position my created meshes.

If I am correct ??
- Blender is developed in Python, and python is a interpretor.
- I did some stuff in Purebasic, and i think PB is a compiler who compiles all to ASM. ??

Q1) is my thinking correct ?

I think this a software problem since blender works very, very fast.
But PB is slow in 2D/3D mixed stuff.

Q2) Is there a good alternative solution to use fast 2D and 3D designing in PB 5.21 ... and later ?

thanks,
marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureBasic <> Python 2D/3D commands

Post by IdeasVacuum »

From Blender.org:
Blender is an open source project licensed under the GNU GPL. All code is written in C, C++ and Python.
So, the main code is likely C/C++ and Python used for scripts/may be User coding (a lot of CAD-CAM apps have this facility for Users and the User coding language varies widely, from bespoke to VBA/VBS, Lua, LSP etc.)

Is the PB 2D slowness the fault of PB/Ogre or could your code design be better? Or perhaps you need to swap Ogre for something else?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: PureBasic <> Python 2D/3D commands

Post by Danilo »

marc_256 wrote:and the speed in 2D to draw stuff on the screen.
Do you use Sprites to draw on the screen? Directly drawing to screen is probably
slow, because the screen memory is located in 'external' graphics card memory.
Using sprites and bitmap fonts should be much faster, but you didn't give much
info nor an example of what you meant.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: PureBasic <> Python 2D/3D commands

Post by Samuel »

As Danilo said it's better to use sprites for 2D drawing especially if your using OpenGL.
marc_256 wrote:I think this a software problem since blender works very, very fast.
But PB is slow in 2D/3D mixed stuff.
Purebasic's 2D/3D is fast if you use sprites, but it also depends on how well you code your apps.
Your comparing your project to Blender which has several expert programmers working on it.
It would be a good idea to post an example showing your speed issues. That way others might be able to help you.

Edit:
I should also mention that although Blender was programmed in C, C++, and Python. They use OpenGL to render everything onto the screen, including the user interface.
marc_256
Addict
Addict
Posts: 862
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: PureBasic <> Python 2D/3D commands

Post by marc_256 »

thanks everyone for your advices,
IdeasVacuum wrote:Is the PB 2D slowness the fault of PB/Ogre or could your code design be better?
Or perhaps you need to swap Ogre for something else?
Well everything works very fast if I use only ogre,
and it works fast if I use only 2D drawing screen tools.

But when I use a mix of 3D / 2D / and direct drawing on the screen,
the mouse jumps in steps, and every redrawing is very slow.
And direct text drawing is a problem.

I don't think this is a Ogre problem.
Danilo wrote: Do you use Sprites to draw on the screen? Directly drawing to screen is probably
slow, because the screen memory is located in 'external' graphics card memory.
Using sprites and bitmap fonts should be much faster, but you didn't give much
info nor an example of what you meant.
I use sprites for all my CAD Menu/Tools/Cursor ...
but text is draw in direct 2D mode.

So, I have to redraw all on sprites ...

I found your GDI+
But is only Windows, so if I want to use multi platform (Win, Linux), I need to use OpenGL.
But is very good stuff.
Samuel wrote:As Danilo said it's better to use sprites for 2D drawing especially if your using OpenGL.
marc_256 wrote:I think this a software problem since blender works very, very fast.
But PB is slow in 2D/3D mixed stuff.
Purebasic's 2D/3D is fast if you use sprites, but it also depends on how well you code your apps.
Your comparing your project to Blender which has several expert programmers working on it.
It would be a good idea to post an example showing your speed issues. That way others might be able to help you.
Yes, I go convert all the text info on sprites, so I can use OpenGL.
But than I still have the mesh problem to solve.

The total program is more than 2.600.000 lines long now, so I need to find some parts of it to show.


Abouth OpenGL, i did some tests, but I have some troubles about meshes.
see http://www.purebasic.fr/english/viewtop ... 36&t=56020
Who works very well in DirectX, but than I can't direct draw text on the screen.


Use PB 5.21 and Win 8.1 - 64 bits
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply