Oxygen Basic
Programming => Example Code => Topic started by: Peter on March 19, 2011, 03:38:29 PM
-
Deleted
[attachment deleted by admin]
-
Hi Peter,
I'll take a look this evening. On the O2 version (A030) I am working on it seems to be okay except there are only a few colors mapped in the grid on the left.
Charles
-
Yes I noticed the speed is slow - about 1/4 second delay between the screen cursor movement and the actual mouse movement.
Windows is not efficient at laying down individual pixels. I will investigate further.
Charles
-
Peter,
If you nobble DrawRectangle, you will see the difference in the screen refresh rate. I do not know what MS does with Setpixel but block copying is probably 100 times more efficient for getting blocks of pixels onto the screen. All your games depend on this factor :)
Charles
Nobbled DrawRectangle!
Function DrawRectangle(byval x2 as long, byval y2 as long, byval x1 as long, byval y1 as long, byval bCol as long)
xor esi,esi
p2: xor edi,edi
p1: mov edx,x2
mov ecx,y2
add edx,edi
add ecx,esi
pushad
'push bcol
'push ecx
'push edx
'push backhdc
'call SetPixel
popad
inc edi
cmp edi,x1
jb p1
inc esi
cmp esi,y1
jb p2
End Function
-
Peter,
I would ease your software development towards using Opengl. Then most of the work gets done on the graphics hardware. You build 2d or 3d shapes as compiled drawing lists then move, scale or rotate them in any direction with very little use of the CPU.
Learning OpenGl is a very good investment because it is not dependent on Windows platforms. There are even simplified versions of Opengl for mobile phones.
I don't think you would have to alter your game design very much - just the bottom layers and to think about shapes and surfaces instead of pixel blocks
Charles
-
I think that Marcus -author of NaaLaa use BitBliter api and work very well.
-
I am in that situation too. Using opengl, but to not be tied to the Windows API. I am looking at various options. In c++ I went with SFML, but it is a c++ based library. SDL and some others are c libraries. There are lots of help for SDL, so that is probably what I will try to get working with Oxygen. SFML is really nice in that it does it all, input, image, sound, fonts, 2d and 3d screens. It can be used as Static or Dynamic links to the libraries. But I don't know if we can use that with Oxygen. Making wrappers or using other libraries in custom languages is not something I have done and so it still seems like magic to me.
-
Any news about Sprite Editor Peter...?
-
Peter...
What you mean about simple Icon Editor ?
I've found two source codes on planetsourcecode but is in VB...
-
Hi Peter ...
In atachments you will find two icon editors written in VB,
i hope that you will mix-up something ;)
[attachment deleted by admin]
[attachment deleted by admin]
-
Of course i mean directly with OxygenBasic :)