Oxygen Basic
Programming => Example Code => Topic started by: Peter on April 10, 2011, 09:58:01 AM
-
Deleted
-
Earthlings, Earthlings! We want your planet. Resistance is useless!
-
Excellent Peter :)
-
I can't seem to get it to run under Wine.
Is this program requesting the full screen to run?
hardcore hoby programmer
hobby not hoby
-
OK ..OK ..hobby ;D
No John ,this program don't need full screen.
OpenWindow "Uffo2",800,600,ws_popup
-
I never see a window either. ???
Maybe Charles can try it on his version of Wine and see if it's just my PC.
-
I can't seem to get it to run under Wine.
John,
One possible problem: WS_POPUP
Ypu could try:
OpenWindow "Uffo2",800,600,CS_HREDRAW or CS_VREDRAW 'ws_popup
Charles
-
No luck.
There is a brief frame of a window displayed (no client content) and it immediately closes.
-
The full screen went black and when it returned, I was left in 800x600 resolution mode. I had to log out to recover.
-
I could get it to run at about 1 frame per second by bypassing the Esc Key test. I think the only way to resolve this in the long term is if Peter could test his software with Wine/Ubuntu - if he is willing.
A few months ago I made a version of "func.inc" that worked correctly in Wine though it is out of date now. The main principle is to stick rigorously to the WinMain / WndProc message processing conventions and also mask off the upper 16 bits of the virtual key state which I think was the cause of the blank window in this case.
Charles
[attachment deleted by admin]
-
I was able to get 2 or the 3 programs to run.
magic8erw.exe failed in a similar way to the Uffo program I can't run.
-
That's okay John. The exe file is now defunct but the scripts are valid.
-
The recompile solved the problem.
That still doesn't explain why Peter's Uffo example doesn't work. Are you saying that Peter is bypassing standard Windows API calls and accessing Windows services at a lower level?
-
Its not low level then is in wine.
Wine probably dont recognize ws_popup style.
ws_popup is style without caption and without sysmenu.
You can try this example:
indexbase 0
include "wFunc.inc"
% WS_CAPTION = 0xC00000
% WS_SYSMENU = 0x80000
INT wstyle
INT w1
wstyle = ws_popup or WS_CAPTION or WS_SYSMENU
w1=OpenWindow "Uffo2",300,300,wstyle
'
do while bRet := GetMessage (&wm, 0, 0, 0)
if bRet = -1 then
'show an error message
else
TranslateMessage &wm
DispatchMessage &wm
end if
wend
[attachment deleted by admin]
-
I was able to get your example to run but the CPU was at 100% and I couldn't get any of the keyboard functions to work. When I closed the window, it left a mess in my upper left corner of my screen. (like previous examples you wrote)
[attachment deleted by admin]
-
I just looking into source code and i was wondering from where you generate
all this graphics.
So ,Peter do you use BitBlt api for sprite blittering?
-
What are you planning? Do you intend to write Uffo3?
Yes, the Api is very stable and you can do plenty of fine things with it.
I do not know why the other members want not write a super game with the wFunc library ? Is so simple like the first school day.
Yes i have in plan write game like this but i currently dont have time for this.
I still study some things.And yes wFunc lib look fine ;)
I do not know why the other members want not write a super game with the wFunc library ?
Yeah,that's good question...i really dont know why?
-
I was wondering where you find all this sprite bitmaps?
I made some search and simply cannot find nothing similiar or some good free sprite creator...
-
Hi Peter
My computer don't have alien but sometimes i think that have gremlins. ;D
Hmm about Charles comp i'm not sure :-\
something is strange...out there ;D
By the way thanks for links...
Allegro is a junk but Reiner tilemaker i will try... ;)
-
The Sirians have shackled me to the motherboard until I make more progress with 64 bit compiling. I hope to be released soon. ;D
-
I do not know why the other members want not write a super game with the wFunc library ? Is so simple like the first school day.
Yeah,that's good question...i really dont know why?
Not really into games myself...
Besides: the only game I would make would be a "Perestroika" clone. But I think the hardest part would be to write the AI for the "Buerokrats" ;D
A driving simulator would be OK as well 8)
bye
-
until I make more progress with 64 bit compiling. I hope to be released soon.
That should turn PowerBasic and FreeBasic programmers heads in your direction. :o
When do you see a Linux port in your crystal ball?
-
I dare not predict, John. The test and debugging phase is hard to quantify. Wherever possible I code and test in small increments to avoid embedding bugs, which have to be traced down later. Once buried in the code, they can be very time-consuming to flush out.
Do you have 64 bit Wine?
Charles
-
Do you have 64 bit Wine?
I'm running on Ubuntu 11.10 64 bit with Wine installed from the Synaptics software installer. Since all the applications I run under Wine are 32 bit, I think not. I didn't know there was a 64 bit version of Wine. I have no interest in 64 bit Windows. I'm waiting for a 64 bit Linux OxygenBasic.
-
It is available but perhaps not perfected yet.
http://wiki.winehq.org/Wine64
-
Hio Peter...
As i say already...i want do some things with this small & simple and great game.
In first place because i don't touch long time ago any game programming.
Ok after few try-s with your new include i decide to download and use old release 036 because
work with game fine( UNFORTUNATELLY -last not work at all)
-
I downloaded the zip file from the first post and I get an error. Unknown type. overlapped line 303 wfunc.h
Peter why do you name the folder temp and the game Ufo2. The folder should be Ufo2 so when we extract it matches what is in it. As with other members here, I make a folder with their name in my oxygen/projects folder. So for you I have oxygen/projects/peter/ now when I extract your zip it should put in your folder oxygen/projects/peter/Ufo2. Instead you name a lot of things temp and it name conflicts. I hate to complain, but you put a lot effort into making nice things for us to try, but you don't put effort into packaging it in a nice manner.
At least this time you had the source, inc and bmps all together in the zip, so thanks for that.
-
Peter...
As i say it compile fine but is execution is to to slow, on my XP computer.
I try change setFPs but nothing heapend.... ???
What might be a problem, i really don't understand.
When i try old example i recive same error like kent with overlapped ::)
It is something very strange, i also discover problem with coulor depth..
I don't know what to say more ... :-\
-
I got a score of 1025. The speed is right for me. It gives me time to react :)
This zip has all the files needed to make it run with a exe file with the runtime built in, so no need for the oxygen.dll.
Just unzip into OxygenBasic\projects\Peter
-
Kent...
Is this some kind of joke or something goes very wrong.
Not work at all,just back image with white rectangles...
what a heck is that ???
Peter...
As i say and i repeat again.
You say that GDI is slow...maybe you right.
BUT how you can explain to me that your original program with version 036 work
incredible fast on my computer and
latest not ?
So mine conclusion is that problem is not in GDI,right?
If you don't believe , download old 036 and try ...
what to say else...
Im very angry about all that problem.... >:(
-
It runs slow on my computer, but I like it slow as it helps me score better :)
It must be the graphic mode as Peter mentioned Aurel. Check what the older version was setting the screen to, I think you said version 036.
-
Im not sure what is wrong here but for example all GDI examples in folder...GDIWindow
like fern,fade...etc work with excellent speed on my both computers with XP
and all this examples use window.inc version 039(Inprogress)
window.inc there is written in old way without call.
Why Peter change way of his header is a mistery to me... ::)
And i was wondering why change something if work fine with good speed?
About using other graphics engines i can say that i try HGE wrapper for EB once and work
perfect.so what about that?
-
It is funny Aurel that you didn't like it with calls either. I went ahead and changed mine to run without calls. attached is the win.h file.
win.7z unzipped will be win.h without calls, interesting to see if it runs better.
-
Refuse to compile properly... ::)
Oh mine...what a mess. >:(
-
Did you get the latest oxygen.dll from here http://www.oxygenbasic.org/forum/index.php?action=dlattach;topic=450.0;attach=905
-
yes Kent i have.
problem is in wFunc or other things (i mean includes)
i do it like this:
Sub WaitFrames(Frame as long)
Sleep Frame
End Sub
And now i can set wait time.
Some problematic things about speed i found in this api calls:
Declare Function QueryPerformanceCounter Lib "kernel32.dll" (ByRef lpPerformanceCount As LARGE_INTEGER) As Long
Declare Function QueryPerformanceFrequency Lib "kernel32.dll" (ByRef lpFrequency As LARGE_INTEGER) As Long
In older inc are declared as LARGE_INTEGER
Type LARGE_INTEGER
lowpart AS INT
highpart AS INT
End Type
In newer are defined as quad.
Which cause some trouble with work to.
So do you can imagine what amount of incompatibility is in game?
Peter work on headers are fine and i respect
but i repeat again why work something if work ok,right?
This only increase confusion...
-
Peter i try this of course...
A full declaration with parameters works anytime sure.
Bingo...!
'Call' is super and the best friend of the programmer.
I don't agree with you at all.
It looks to me that call is another word for import like some
other languages have.
But as i say i don't see any advantage to use this way because don't
work properly for me ,but old way with old wFunc work and
looks that i will use this old method.
First looks simplier to me and is quite better to understand what is what.
PS.Peter
You say that GDI is slow and i agree that GDI is slower then hardwer acelerated graphics
BUT i see many GDI examples written in C which work excellent.
I must investigate this thing much closer. ::)
-
I found that, Uffo got a lot faster when the background image was replaced by clsColor. Perhaps this large element was causing problems for Aurel.
One advantage of using bind is that the compiler knows that all the defined symbols are procedures, then call is automatically inserted. You can still use call with any procedure, if that is your preference.
I have included a compact version of uffo with the latest Oxygen, filed in projects/games, along with win.inc. But I'll continue to support projects/GDIWindow/window.inc, as we have many demos that depend on it, and I think most Basic users would prefer a prototyped API, where the compiler takes care of type conversions and referencing.
I am delighted we have a complete game, Peter, small enough to include in the OxygeBasic zip :)
Charles
-
I agree with Charles...
And i just tested many gdi examples with win64.inc and most of them work fine ;)
-
Hi Kryton9,
There is no more speed with 'Bind'. 'Bind' is not sure !
Many of the Opengl declarations and GdiPlus with 'Bind' did not go, at least here.
A full declaration with parameters works anytime sure.
'Call' is super and the best friend of the programmer.
Try this to see how many frames has 'Kryton9 Win.inc' and 'Peter win.inc'.
I got (1080-1082 frames).
I just found a wave file and bmp file, nothing to run Peter.
-
Don't give up Peter. You and Charles are the only ones that make headway with assembly and bringing headers to the rest of us. I am studying all the headers I can to learn, but it is all very confusing as there are so many ways people do it in so many languages.
-
Yes i agree with Kent, don't give up man... ;)
I hope that you don't interpret in a wrong way my observation.
I like & follow your work all the time...