Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - aonyn

#61
Hi Ian (or anyone who knows the answer)

I have written an app using my partially complete xors3d header.
Now I want to try and convert it to you ixors3d header and compile for iphone, but I am not entirely clear how to setup ixors3d for glbasic.

I did see an earlier post in this thread, referring to a txt file which explains the setup, but alas, I cannot find the file. It appears the 7z file with your header only has the gbas file, there are no other files extracting.

Where may I find these instructions, or a brief rundown in a post here I would greatly appreciate.

Thanks in advance,
Dave
#62
Thanks Gernot   :)

Regards,
Dave
#63
Hi Gernot,

I have a request for the IDE, specifically the display of functions in types on the jumps display.
Would it be possible, if the type could be listed as well as the type.

Perhaps for this sample code...
Code (glbasic) Select

TYPE foo
    FUNCTION bar:
    ENDFUNCTION
ENDTYPE


The jumps display would show the function bar as foo.bar

The reason for this request is, I have numerous types in my current project, many share embedded function names, such as load, set, get, kill, etc.
Now in the jumps display, I only see many instances of these common names, rather than conveniently seeing the associated types for each.

Of course this is not essential, but would be very helpful if possible.

Thanks,
Dave
#64
Thanks trucidare,

I will experiment with it as I have time, and I hope you don't mind, I may take you up on the offer for PM questions if I get stuck (I promise to try not to be annoying about it)  :)

regards,
Dave
#65
Hi MrTAToad,

I am planning to buy a copy of your book, but have to wait for more pay to come in.
Does the 2nd site you linked to break free from the 2 week limit, or is it a case of get it now, or miss out if it does not sell enough?

Normally I would purchase the pdf for something like this.
Do you earn more money for printed book sales, or is the price of the pdf based on the printed price, minus production costs?
If you earn the same amount either way, I will opt for the pdf, however, if you earn extra for the printed book, I will purchase that just to support a community member.

Best of luck, I hope it does well for you.

Regards,
Dave
#66
Thanks MrTAToad,

Explained that way, it does make sense.

regards,
Dave
#67
Hi Uncle,

http://www.glbasic.com/forum/index.php?topic=4604.msg37163#msg37163

According to this, you must download the new setup to go from 7 to 8.

Regards,
Dave
#68
Hi All,

EUREKA! It works, finally!   :booze:
I am passing strings both to and from the xors3d dll, with a bit of help from PureBasic.

Here is how I am passing strings to:

PureBasic DLL
Code (glbasic) Select

Prototype pbp_xChangeDir(path.p-utf8)

ProcedureDLL xChangeDir(path.s)
If OpenLibrary(0, "xors3d.dll")
pb_xChangeDir.pbp_xChangeDir = GetFunction(0, "_xChangeDir@4")
CloseLibrary(0)
EndIf
EndProcedure


GLBasic Wrapper
Code (glbasic) Select

INLINE
extern "C"
{
DECLARE_ALIAS(glb_xChangeDir, "xors3d_TextConvert.dll", "xChangeDir", (const char*), void);
}
ENDINLINE

FUNCTION xChangeDir: path$
INLINE
if(glb_xChangeDir)
glb_xChangeDir(path_Str.c_str());
ENDINLINE
ENDFUNCTION


And here is how I am receiving strings from:

PureBasic DLL
Code (glbasic) Select

Prototype.i pbp_xCurrentDir()

ProcedureDLL.s xCurrentDir()
If OpenLibrary(0, "xors3d.dll")
pb_xCurrentDir.pbp_xCurrentDir = GetFunction(0, "_xCurrentDir@0")
outputString$ = PeekS(pb_xCurrentDir())
CloseLibrary(0)
ProcedureReturn outputString$
EndIf
EndProcedure


GLBasic Wrapper
Code (glbasic) Select

INLINE
extern "C"
{
DECLARE_ALIAS(glb_xChangeDir, "xors3d_TextConvert.dll", "xChangeDir", (const char*), void);
}
ENDINLINE

FUNCTION xCurrentDir$:
LOCAL currentDir$
INLINE
if(glb_xCurrentDir)
currentDir_Str = glb_xCurrentDir();
ENDINLINE
RETURN currentDir$
ENDFUNCTION


Now the part which baffles me a bit is, the dll function is supposed to return a const char* according to the documentation.
However, to get the return, I had to receive the return as an integer, then used the function as the argument for the PeekS command.
This argument refers to a memory address, so it appears the function returns a memory address to the string, and I am grabbing the string from memory, and saving it to a variable which finally I am returning to GLBasic.

Is this expected behavior for a const char* return, or is the function acting differently than it is documented?

No matter though, because what I have done is now working as expected, and I am moving forward with the wrapper. I would still like to know why this works as it does though, to satisfy my own curiosity, so feedback is appreciated.

Thanks everyone for your help, and of course I will provide this wrapper to the community (including the PureBasic source code) when it is ready, although I can't promise I will be done quickly, as I am doing this for amusement, and have real world responsibilities which must come first. Also, I am still on the coding learning curve, so I can't say whether I will hit more stumbling blocks along the way, but I am sure I will have fun solving problems, and learning new skills.

regards,
Dave
#69
Game Name: Slide Puzzles – Military Choppers
Game Publisher: RLT Interactive, LLC.
Game Genre: Puzzle
Game Cost: $0.99
App Store Link: http://itunes.apple.com/us/app/slide-puzzle-military-choppers/id379094022?mt=8
Web Page: http://www.rtlsoftware.com/

Description:
Time yourself and challenge your friends to solve these tricky
slide puzzles adapted for the iPhone and iPod Touch.  The aim is to
get them back in order so that the picture is restored.  Each of the
sixteen puzzles is randomly scrambled and solvable 100% of the
time.  The tiles are created from high quality military helicopter
photos, courtesy of the US Government.  Test your patience in
arranging the pieces in the correct order.

Features:
• 16 slide puzzles created from beautiful photographs of
military helicopters.
• High Scores stored, so you can always challenge yourself,
based on time and number of moves.
• View the original photos from the in-game menu.
• In-Game menu is accessible by shaking the device while in
game mode.

Screenshots




#70
Game Name: Slide Puzzles – Military Planes
Game Publisher: RLT Interactive, LLC.
Game Genre: Puzzle
Game Cost: $0.99
App Store Link: http://itunes.apple.com/us/app/slide-puzzle-military-planes/id378841107?mt=8
Web Page: http://www.rtlsoftware.com/

Description:
Time yourself and challenge your friends to solve these tricky
slide puzzles adapted for the iPhone and iPod Touch.  The aim is to
get them back in order so that the picture is restored.  Each of the
sixteen puzzles is randomly scrambled and solvable 100% of the
time.  The tiles are created from high quality military aircraft
photos, courtesy of JetWalls and the US Government.  Test your
patience in arranging the pieces in the correct order.

Features:
• 16 slide puzzles created from beautiful photographs of
military aircraft.
• High Scores stored, so you can always challenge yourself,
based on time and number of moves.
• View the original photos from the in-game menu.
• In-Game menu is accessible by shaking the device while in
game mode.

Screenshots




#71
Game Name: Slide Puzzles – Diabolic Fruit
Game Publisher: RLT Interactive, LLC.
Game Genre: Puzzle
Game Cost: $0.99
App Store Link: http://itunes.apple.com/us/app/slide-puzzle-diabolic-fruit/id376520221?mt=8
Web Page: http://www.rtlsoftware.com/

Description:
Time yourself and challenge your friends to solve these tricky
slide puzzles adapted for the iPhone and iPod Touch.  The aim is to
get them back in order so that the picture is restored.  Each of the
sixteen puzzles is randomly scrambled and solvable 100% of the
time.  What makes this so difficult is that the tiles are beautiful
photos of fruit.  Test your patience in arranging the pieces in the
correct order.

Features:
• 16 slide puzzles created from beautiful photographs of fruit.
• High Scores stored, so you can always challenge yourself,
based on time and number of moves.
• View the original photos from the in-game menu.
• In-Game menu is accessible by shaking the device while in
game mode.

Screenshots




#72
Hi Ocean,

Thanks, the tip was very helpful.

Some built in method of communicating with different string encodings would be very useful indeed.

Purebasic handles it with pseudotypes, but from what I can tell, pseudotypes only work with parameters, not returns.
I think I will have to write a function to manually decode the return.

It appears that the best way to do this will involve allocating memory, and a lot of peak/poke.
This is all new territory for me, but I will certainly learn a lot doing it.

regards,
Dave
#73
Well, sending arguments to UTF8 is solved  :)
however, receiving the return back to ascii, not so much  :doubt:

Well, I will figure it out, I at least know what the problem is.  :good:
I will post back as I make progress.

Regards,
Dave
#74
Hi All,

Good news, I think I have a solution, my initial test works as expected.
I tried unicode, and that still did not work correctly.
The key was, UTF8 as the expected string format.
I am using a helper dll which I am writing in purebasic with pseudotypes.

Here is the code in purebasic.
Code (glbasic) Select

Prototype pbp_xAppTitle(title.p-utf8)

ProcedureDLL xAppTitle(title.s)
If OpenLibrary(0, "xors3d.dll")
pb_xAppTitle.pbp_xAppTitle = GetFunction(0, "_xAppTitle@4")
pb_xAppTitle(title)
CloseLibrary(0)
EndIf
EndProcedure


Then I declare the helper dll this way in GLBasic.
Code (glbasic) Select

DECLARE_ALIAS(glb_xAppTitle, "xors3d_TextConvert.dll", "xAppTitle", (const char*), void);


And finally I wrap it in a GLBasic function.
Code (glbasic) Select

FUNCTION xAppTitle: title$
INLINE
if(glb_xAppTitle)
glb_xAppTitle(title_Str.c_str());
ENDINLINE
ENDFUNCTION


And EUREKA, it works!!!
Perhaps there is a more efficient way to do it, but for now, I am just happy to have solved the problem, and can continue wrapping xors3d.  =D

Thanks everyone for all your input.
Without the hints, I would probably still be stuck on step 1.

regards,
Dave
#75
Thanks Kitty Hello,

I will try that and post back here to say whether it was the solution or not.

regards,
Dave