[Solved] Dig Framework Build Issues

BlitzMax Forums/Brucey's Modules/[Solved] Dig Framework Build Issues

RustyKristi(Posted 2016) [#1]
Hey Derron,

..so finally I got to build 0.78 mods and this is now where I'm at:

interpolation
Compile Error: Unable to find overload for drawoval(Double,Int,Int,Int). Argument #1 is "Double" but declaration is "Float".

and the rest of the samples I just get this same error:

Dig-master/.bmx/base.util.xmlhelper.bmx.release.win32.x86.c:297:59: error: 'struct BBClass__m_libxml_TxmlNode' has no member named 'm_getName'

colorize now builds btw and it looks great :)

thanks.


Brucey(Posted 2016) [#2]
Unable to find overload

You can use the -w compiler flag ("Overload Warnings" in the NG MaxIDE) to raise a warning rather than an error.


Derron(Posted 2016) [#3]
M_getname

Did you do a full recompile? Looks like you dir a quick one with some old data.


Bye
Ron


RustyKristi(Posted 2016) [#4]
Hey Derron, yes I did a full recompile. The -w flag solved the overload errors, just the m_getname I'm still having issues with.


RustyKristi(Posted 2016) [#5]
Ok I'm close and I think I found some typos:

https://github.com/GWRon/Dig/blob/master/samples/settingsscreen/settingsscreen.bmx#L353

This one missing a closing double quote, and the line below throws Error: Syntax error - expecting identifier.

rendererTexts : + ["DirectX 7", "DirectX 9"]


RustyKristi(Posted 2016) [#6]
Ok I'm close and I think I found some typos:

https://github.com/GWRon/Dig/blob/master/samples/settingsscreen/settingsscreen.bmx#L353

This one missing a closing double quote, and the line below throws Error: Syntax error - expecting identifier.

should be? rendererTexts :+ ["DirectX 7", "DirectX 9"]


I think I only have issues with all the screendemo, settings example and demoapp. This is with demoapp
Compile Error: Unable to convert from (TGUIobject) to Int(TGUIobject).


Derron(Posted 2016) [#7]
Yeah, custom method and NG blames "method a:int()" versus "method a()".

Will fix them when at home.


How did you resolve the m_getname error?

bye
Ron


RustyKristi(Posted 2016) [#8]
Hey Ron,

Not yet, I'm still getting that libxml thing. I have your libxml that is included in the repo but let me try that again later.


RustyKristi(Posted 2016) [#9]
Ok so I recently found another example bug and hi-lighting it:

https://github.com/GWRon/Dig/blob/master/samples/settingsscreen/settingsscreen.bmx#L350-L354

the defined is rendererValues but the assignment is just renderValues

Other than that, I'm getting linker errors:

demoapp (Line 56, Unable to convert from (TGUIobject) to Int(TGUIobject).)
gui (nanohttp, undefined reference to `WspiapiGetAddrInfo@16')
reflection (Unable to convert from Void to Byte Ptr.)
registry (you're keeping it to minimum as commented but I had to remove BRL.standardio to compile and run)
screendemo (nanohttp, undefined reference to `WspiapiGetAddrInfo@16')
settingsfile (same as above)
settingscreen (same as above)


Derron(Posted 2016) [#10]
>> registry (you're keeping it to minimum as commented but I had to remove BRL.standardio to compile and run)

This sounds as if something is borked in your setup.
Maybe Brucey can shed some helpful light here.


Getaddrinfo
Mingw issue?!


Bye
Ron


RustyKristi(Posted 2016) [#11]
I'm not sure, I already recompiled the modules 3 times already and git cloned new install, and other Dig examples works great, just those remaning.

BTW, found the Getaddrinfo issues fix on stackexchange and it is a common issue, I just placed this on top on all affected examples..


Getaddrinfo
Mingw issue?!


?Win32
Import "-lws2_32"
?

So are you compiling your library on Linux only? must be the reason.. :-)

..and maybe there's a switch/condition on these examples since it does not use winsocks or sockets? or does it?


RustyKristi(Posted 2016) [#12]
BTW, the GUI features looks awesome!! :D Is there a particular setup so it can mix with OpenB3D? or do I just use BeginMax2D() and EndMax2D()?


RustyKristi(Posted 2016) [#13]
>> registry (you're keeping it to minimum as commented but I had to remove BRL.standardio to compile and run)

This sounds as if something is borked in your setup.
Maybe Brucey can shed some helpful light here.


Update: I think I found the problem, using Import instead of Framework did it. I'm sure this applies to all other examples with the same error. I don't have to set the -lws2_32 flag anymore.

Now just left with these Ptr conversion errors..


RustyKristi(Posted 2016) [#14]
...


Derron(Posted 2016) [#15]
That getaddrinfo should not be used anywhere in the samples (there is networking code in Dig, but not in the samples I provided).

So if this is somehow required, then there is surely something borked on your setup.

I compiled many samples in a Windows XP VM, no issues there (regarding getaddrinfo). Also you state, that you need to remove "Framework Brl.StandardIO" - this means, you are literally importing _all_ modules provided by the blitzmax-base. This should only be needed if I forgot a manual import (in this case it should not compile on my setups too).


@OpenB3D
Never used it, so I dunno. The GUI just uses normal "DrawImageSubRect()"-Commands (drawing portions of an image). It relies on a custom TSprite-type (which relies on that DrawImageSubRect and images).


@Conversion
Will try to fix now what was reported (might have missed some commits as I am locally playing with some kind of "textarea"-gui-widget).


bye
Ron


RustyKristi(Posted 2016) [#16]
That getaddrinfo should not be used anywhere in the samples (there is networking code in Dig, but not in the samples I provided).

So if this is somehow required, then there is surely something borked on your setup.


No again, I just used Import instead of Framework with brl.standardio and I don't have to do anything extra. :-)

Question, is there a FSM or some sort already implemented or are you planning to add it later. I'm seeing this feature in the screendemo but I assume that's hardcoded in screenmanager or its different on its own.


Derron(Posted 2016) [#17]
FSM?
Full Screen Mode?

TGraphicsManager.GetInstance().SetFullscreen(True, True)

the second "True" is to reinit graphics (else it just switches the variable). Use this if you already opened up the graphics. If you call this before "InitGraphics()" then this second "True" is not needed.



@framework and import
What you did is: you import more modules than I did. I dunno which module fixed your issue - and why it should do that way.

Like said: compiled here without issue on my windows box.


Edit: Updated framework - dunno if some samples still fail with NG (just tried the ones you mentioned).


bye
Ron


RustyKristi(Posted 2016) [#18]
Ok on my build I can also use framework but I need the -lws2_32 winsock flags so it builds ok. I don't know why it needs that on my build but it works anyway.

FSM, finite state machine or simply Game States, sorry I got used to calling it FSM :X

I think you have it in fadingstate.bmx. I was looking for more a component type where you can use it on other entities or types like sprites, sounds, menu, etc..

I found another 2d framework (Weibow's Game2D) a while back with that game state feature but it's more of a 2D retro 8bit feel to it

https://github.com/wiebow/game2d.mod/blob/master/source/state/TState.bmx


Derron(Posted 2016) [#19]
I would use the ScreenManager for this (base.framework.screen.bmx). Sample is then "screendemo".

Screens are more "scene/stage"-like, "gamestates" are more abstract.


So simple games could use a "title screen", "menu screen", "game screen", "gameover screen" ... think you got it.


I never used them in my game TVTower that way (having another screen-type and manager there). Also I only use such things only for "render effects" (aka fading between things). In my game I just have a integer describing the game state (menu, ingame, ...) and then set my active "screen" accordingly.


Please do not expect everything to work flawless and be uber-convenient. I just extracted things out of my game and tried to make them reuseable.


bye
Ron


RustyKristi(Posted 2016) [#20]
Thanks Derron, demoapp works great now!

My only concern is if it will work on Android. I see you made some driver changes but running the colorize example on my device crashes it with app stopped message.


Derron(Posted 2016) [#21]
did not try it... maybe graphicsmanager needs some tuning after the latest changes but some months ago, brucey successfully run "demoapp" on his android (used it as testbed).

Force stop could have various reasons. What is catlog saying! (The android log).


Bye
Ron


RustyKristi(Posted 2016) [#22]
did not try it... maybe graphicsmanager needs some tuning after the latest changes but some months ago, brucey successfully run "demoapp" on his android (used it as testbed).


that's good to hear and I'm curious about the setup to android

yes, I'll check on the logs later..


Derron(Posted 2016) [#23]
Import "-lws2_32"


Could you try out if this is also needed for most simple NG-apps?

SuperStrict
Framework Brl.StandardIO

print "hi"

(I assume this will work...)
If this is needed there too: raise an issue on github (github.com/bmx-ng) or ask Brucey here in the forums.

Now extend it to:
SuperStrict
Framework Brl.StandardIO
Import "Dig/external/libxml/libxml.bmx"

print "hi"

If this is not needed yet, we should check which kind of module needs winsock - as I assume the module does not really need it :-).
I am preeeetty sure, that none of my source files accidentally imports networking code and therefor should be requiring such things like winsock.
Only exception here is "libXML" (Brucey's LibXML-wrapper) as it has some "nanohttp.c"-files.
Other chances are the "stream"-modules of BlitzMax, as they support HTTP-streams.

Biggest chance is of course: an error on your computer setup (minGW, version of the modules, of bcc ... something) as else chances are high that others would have mentioned a similar problem. But like said, problem might be everythere, so the "sample code" above will help narrowing things down.




bye
Ron


Derron(Posted 2016) [#24]
Your "Force Close" might happen because of this:

E/art     ( 1100): dlopen("/data/app/com.blitzmax.android-1/lib/arm/libcolorize.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "bbSystemPostSyncOp" referenced by "libcolorize.so"...
E/AndroidRuntime( 1100): Process: com.blitzmax.android, PID: 1100
E/AndroidRuntime( 1100):    at com.blitzmax.android.BlitzMaxApp.<clinit>(BlitzMaxApp.java:10)


This happened to me, as soon as my code imported "brl.mod/timer.mod" (eg. via "Brl.retro").
This is why things like "samples/interpolation" work fine (you will need the newest version of the sample - from git), they do not use the graphicalapp-framework-code (which uses brl.retro).

Will have to see if I did miss to import something, or if my assumptions about the module-bug are true (created an issue for it on github).


bye
Ron


Brucey(Posted 2016) [#25]
Brl.retro

Don't use it. It is called "retro" for a reason :-p

Brl.Timer

SDL has its own timer. You should probably use that instead :-)
I should probably disable brl.timer for eg. android...


Derron(Posted 2016) [#26]
Yeah, wasn't brl.retro - but somewhat is using "brl.timer" (even if I did not find a brl.mod/* which imports "brl.timer" - and my Dig-code does not import brl.timer too)

@ using SDL-timer
Dunno if this is used automatically then (which would be good) - I mean, as soon as you use one of the modules trying to use brl.timer (maybe this means splitting "brl.timer" to "brl.timerdefault" and "sdl.timer" or so)

bye
Ron


RustyKristi(Posted 2016) [#27]
Could you try out if this is also needed for most simple NG-apps?


Actually, Dabhand's firepaint example is one benchmark example for my NG build. I don't need to place any extra linking and it works fine. Other examples works as well with Win32 and Android w/o the winsock linking.

Is the graphicsmanager updated now to properly run android builds?


RustyKristi(Posted 2016) [#28]
Tested: Interpolation example works great on android.. just need to setup sdl virtual keyboard though.


Derron(Posted 2016) [#29]
Either virtual keyboard, or "touchable" areas (check if a touch was in a specific rect - like a button).


@graphicsmanager
it should. As long as that timer-thing is enabled for android builds, compilation issues might happen.


bye
Ron


RustyKristi(Posted 2016) [#30]
Thanks Derron, I did try vkeyboard on one of the sdl examples.

I'm now checking with the timer thing if it will work out.


Derron(Posted 2016) [#31]
Updated "demoapp" (and Dig ;-)).

Demoapp now runs on android (just copy the "res"-folder in the newly created android-projectfolder/assets). There are some issues left (logo displayed at wrong position - think there is the wrong variable used, dropdown-elements ignore viewports).

All in all it works ...


bye
Ron


RustyKristi(Posted 2016) [#32]
Awesome, Thanks! :D

BTW, do you happen to know or currently using any existing 2D framework like platformer or isometric? I don't know anything that works atm with NG and I don't have any fix for DWLab yet.


Derron(Posted 2016) [#33]
I only use my framework - so no, do not know other frameworks compatible to NG.


bye
Ron


RustyKristi(Posted 2016) [#34]
I can build it but getting exit crashes. I see you already set it for cross-platform with the driver stuff which is nice. I still need to set the winsock flag otherwise I'm getting linker errors.

I also have to mention that my fps is only 30 on desktop. Is this fix or you can adjust it?


Derron(Posted 2016) [#35]
this is set in the deltatimer init()-call. set it to "-1" to disable the throttle.


@ exit crashes
on android?

@ winsock
on android?


bye
Ron


RustyKristi(Posted 2016) [#36]
yes on android. desktop works great


Derron(Posted 2016) [#37]
I do not know why Android should use "winsock" at all. Maybe someone else is able to answer this question.


@ exit crashes
something interesting in the logcat ?


bye
Ron


RustyKristi(Posted 2016) [#38]
Ok I forgot to try android without the flag, brb..


RustyKristi(Posted 2016) [#39]
I'm seeing Init(60,-1) where -1 is the renders per second, is that it? or -1,-1?

Should this be more app specific?


RustyKristi(Posted 2016) [#40]
I'm seeing Init(60,-1) where -1 is the renders per second, is that it? or -1,-1?

Should this be more app specific?

BTW, I forgot to mention that I did use the conditional flag so it was not included in the android build

?Win32
Import "-lws2_32"
?

see above previous post..


Derron(Posted 2016) [#41]
60 = updates per second
-1 = frame rate limitation

Instead of asking such things - try to help yourself by having a look at the source code:

	Method Init:TDeltaTimer(UpdatesPerSecond:int = 60, RendersPerSecond:int = -1)



The more you read in the frameworks sources, the more questions might get answered on its own.



bye
Ron


RustyKristi(Posted 2016) [#42]
Yes I saw that just now, thanks

Can you post your demoapp apk for checking? maybe I missed some items here..


Derron(Posted 2016) [#43]
http://www.digidea.de/files/demoapp-debug.apk
(it is a bit bigger because of libXML etc)

Compiled for armv7 with a patched SDL.mod (else I had trouble with SetViewport and Cls()).

Patch can be found in the current list of "Pull Requests" of github.com/bmx-ng/sdl.mod.


PS: I get these little issue on the smartphone now too: when I exit via "back button" I cannot start the app again - until I remove it from the running ones ([]-button pressed and swiping away the app).

Edit: adding an "End" at the demoapp.bmx results in a correctly exited app (restart possible). Reuploaded apk now (13:54).

bye
Ron


RustyKristi(Posted 2016) [#44]
Thanks I tried it and it works, got another round with my build and I think I just forgot to add the res folder and it runs perfectly. I got my build only at 2.4mb

The virtual screen resolution looks really nice!


Derron(Posted 2016) [#45]
binary sizes depend on the used SDK/NDK etc - similar to GCC (newer versions were bigger than older ones here).


bye
Ron


RustyKristi(Posted 2016) [#46]
Yes, I forgot about that stuff.

Anyway, I did notice some alignment issues particularly the dropdown gadget which in android is a bit off, in desktop it's not a problem.

I could take a screenshot later on.