is it possible to use Awesomium inside Bmax?

BlitzMax Forums/BlitzMax Programming/is it possible to use Awesomium inside Bmax?

Riva(Posted 2013) [#1]
Hi,

First. sorry about my english.

is there anybody how has try to use Awesomium (http://awesomium.com/)
to use as GUI for Fullscreen Games?

I think that one of the biggest Problem in making Fullscreen Games is that there is no right gui.
If you have Access to a Fullscreen Html Renderer a lot of Problems a gone. You than can use html, css, php, mysql, jave, jquery, and and and.. to make a very good gui.

i have spend now 5 days to figure out how to use the awesomium.dll or sourcefiles (.h). But nothing wors for me, because iam a total newbie in using dll files or c# c++.

Is it possible to write a wrapper for this great awesomium?


Yasha(Posted 2013) [#2]
Looks like a very nice project.

Unfortunately the Windows version seems to be designed with Visual Studio development in mind. Historically importing VC++ stuff into BlitzMax is a real pain, because BlitzMax is designed to work with MinGW instead (MinGW is a mostly-superior way to use C++ on Windows, but the two are not really compatible: they emit different code and BlitzMax is only designed to link to the kind emitted by MinGW). The .NET version might provide a way around this (?).

Also it has one of those odd semi-commercial licences, which is a minor turnoff.


Altogether though it seems like overkill if you just want to use it for a GUI. Game GUIs rarely need to be very powerful or complicated and you can bake most of their functionality directly into your program easily enough. A simple UI also doesn't need full HTML+CSS, when you could just have a built-in style that suits your game and use a plain XML file to define the layout.


Brucey(Posted 2013) [#3]
Historically importing VC++ stuff into BlitzMax is a real pain

Of which the easiest way is to create a C wrapper dll that your BlitzMax app can use.


Riva(Posted 2013) [#4]
@ Yasha


Unfortunately the Windows version seems to be designed with Visual Studio ....


Thanks for the info. Thats the reason of my Trouble that i can't get anything to work :-(

Altogether though it seems like overkill if you just want to use it for a GUI.


Have you ever mad a ingam Gui for a RPG or such a game where a Shop Dealer has hundrets of itms? Buying, sorting, filteriung, drag drop, info Pop Ups, inspect, scolling, resize window. Thats all easy with php and a jqury + jquery ui plugin combination.
300 Lines of code (php + mysql + javascript) agains howmany lines of code in bmax?
Thats my Intention.

Do you know EVE online. i think 80% of the Gui is written in php or another scripting language like asp or Pearl + css and Javascript.


Yasha(Posted 2013) [#5]
Have you ever mad a ingam Gui for a RPG or such a game where a Shop Dealer has hundrets of itms? Buying, sorting, filteriung, drag drop, info Pop Ups, inspect, scolling, resize window.


Actually I have (or rather, started and given up halfway), and you're right, it was horrible hardcoding it, and I wouldn't want to do that again. When I said "overkill for a GUI" I was just thinking of a main menu in an FPS type thing.

This is an interesting topic. I'm wondering if one of the more open engines like maybe XULRunner would work more easily for this...


Russell(Posted 2013) [#6]
@Riva: Have you had a look at Brucey's CEGUI wrapper module? It is specifically designed for an in-game GUI and works quite well. You can get it here (You'll need an svn client):
http://maxmods.googlecode.com/svn/trunk/cegui.mod
http://maxmods.googlecode.com/svn/trunk/ceguiopengl.mod
If you're going to be using DirectX (on Windows), grab this, also:
http://maxmods.googlecode.com/svn/trunk/ceguidirect3d9.mod

Believe me, it sure beats writing the whole thing from scratch! Hope this helps!

Russell


Riva(Posted 2013) [#7]
@Russell

thanks. I take a look at it.^

Edit:
Dosnt work.
100 Compiler Errors.
I Have than find out that i Need bah.freeimage + bah.regex
Searching again.....
Cant download it from Google code. Error 500
Fount it elswehere. Download. Install.

Cant Compile:
In file included from C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibOpenJPEG/opj_includes.h:108,
from C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibOpenJPEG/bio.c:32:
C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibOpenJPEG/opj_malloc.h:75:25: mm_malloc.h: No such file or directory
Build Error: failed to compile C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibOpenJPEG/bio.c

Searching again. Found that it can be a wrong opj_malloc.h
Searching again. Copy a new one. Dosnt work again.

:-(


Yasha(Posted 2013) [#8]
I took a look through a whole load of layout and HTML engines, focusing on the smaller ones, and eventually hit upon this: http://librocket.com/wiki

Looks like it's specifically designed for your needs (and BlitzMax in general)! Small, supports MinGW, designed to render HTML directly into a graphics buffer over a game, MIT licence. Supports Python rather than JavaScript for scripting out of the box, but that can be changed. There's a project integrating it with the V8 JavaScript engine with an explicit eye to using jQuery here: https://github.com/realazthat/v8.rocket


Russell(Posted 2013) [#9]
@Riva:
Do you mean you had all of those errors when compiling CEGUI? I was having some trouble compiling certain modules (especially wxMax), and after I followed this very helpful guide from Brucey ( http://blitzbasic.com/Community/post.php?topic=100077&post=1178860 ) all was fixed and pretty much everything compiles and works now except for a few modules that apparently haven't worked for a while (raknet and Maxmod2, for example).

To use the script Brucey's script in the above post-link, be sure and download and install gawk (if you're on Winodws) using his link (and don't forget to put the gnuWin32/bin location in your system's PATH). After I followed this script ~everything worked as expected.

Hope this helps.
Russell

p.s. @Yasha: libRocket looks interesting, and has an MIT license which is very nice. I couldn't tell, from the source code size, how much of a footprint it creates, but I'm guessing it's quite small, since it runs on iOS and Android.


Riva(Posted 2013) [#10]
@Yasha
Thanks for the librocket link's
I will try it. But isn't it make with vc++ too? I hope ist not the same pain like the awesomium library.

@Russel
I have the Errors when i try to compilling bah.freeimage
I only want to Play around with CEGUI. But it looks like i have to install
ba.hfreeimage and bah.regex too to use cegui
I dont want to use wxMax. Is it needed to for CEGUI?
Please, dont tell me i have to download half of the Internet to use cegui.

C:/BlitzMax/mod/bah.mod/freeimage.mod/src/LibOpenJPEG/opj_malloc.h:75:25: mm_malloc.h: No such file or Directory

Thats the Problem. My OS is win7 pro 64bit


Brucey(Posted 2013) [#11]
See this post for a workaround to the mm_malloc.h problem.
It's probably because you have an old version of MinGW, and new libraries expect a new/current version of MinGW to build against.


Riva(Posted 2013) [#12]
@Brucey

i allready have done this yesterday.
...but i do it again.


Try changing this bit at line 66 :
#ifdef __GNUC__
#include <mm_malloc.h>
#define HAVE_MM_MALLOC

to this
#ifdef __GNUC__
#include <malloc.h>
#define HAVE_MM_MALLOC





In my File (opj_malloc.h) there is at Line 71 (not 66)
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
#ifdef _WIN32
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
#ifdef __GNUC__
#include <malloc.h>
#define HAVE_MM_MALLOC

I have Change Line 75
from
#include <mm_malloc.h>
to
#include <malloc.h>


I now can compille ALL modules.
But when i try a CEGUI Example (textdemo and all other Demos too) new errors happens to me.

C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(tcd.c.debug.win32.x86.o):tcd.c:(.text+0x8b5): undefined reference to `_mm_malloc'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(tcd.c.debug.win32.x86.o):tcd.c:(.text+0x1b0b): undefined reference to `_mm_malloc'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(tcd.c.debug.win32.x86.o):tcd.c:(.text+0x510e): undefined reference to `_mm_free'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(tcd.c.debug.win32.x86.o):tcd.c:(.text+0x5552): undefined reference to `_mm_malloc'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(tcd.c.debug.win32.x86.o):tcd.c:(.text+0x5bb8): undefined reference to `_mm_free'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(dwt.c.debug.win32.x86.o):dwt.c:(.text+0x1e9b): undefined reference to `_mm_malloc'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(dwt.c.debug.win32.x86.o):dwt.c:(.text+0x202b): undefined reference to `_mm_free'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(dwt.c.debug.win32.x86.o):dwt.c:(.text+0x2817): undefined reference to `_mm_malloc'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(dwt.c.debug.win32.x86.o):dwt.c:(.text+0x2bc6): undefined reference to `_mm_free'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(t1.c.debug.win32.x86.o):t1.c:(.text+0x238f): undefined reference to `_mm_free'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(t1.c.debug.win32.x86.o):t1.c:(.text+0x23a6): undefined reference to `_mm_malloc'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(t1.c.debug.win32.x86.o):t1.c:(.text+0x241b): undefined reference to `_mm_free'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(t1.c.debug.win32.x86.o):t1.c:(.text+0x2431): undefined reference to `_mm_malloc'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(t1.c.debug.win32.x86.o):t1.c:(.text+0x2d4f): undefined reference to `_mm_free'
C:/BlitzMax/mod/bah.mod/freeimage.mod/freeimage.debug.win32.x86.a(t1.c.debug.win32.x86.o):t1.c:(.text+0x2d60): undefined reference to `_mm_free'
Build Error: Failed to link C:/BlitzMax/mod/bah.mod/cegui.mod/examples/textdemo.debug.exe


Russell(Posted 2013) [#13]
@Riva: All I can say is that I used to have lots of errors, too, when I rebuilt modules and/or running examples until I followed Brucey's step-by-step procedure (including downloading gawk and running the command-line script he gives). Freeimage compiles perfectly (as does CEGUI) and all of the examples work after following his directions (See the link in one of my posts above). It moves (copies) everything that needs to be moved, etc. I also have Windows 7 64 bit so it should work for you, too.

No, you don't need wx for CEGUI (Thank Zeus! Wx is H U G E!).

What version of minGW do you have installed? (I agree it SHOULDN'T matter, but unfortunately it does).

Russell