<< Previous | Home | Next >>

Found my baby, Wood Games 3D

My baby, Wood Games 3D, is not available in google play anymore (for some time now), because I did not respond to some messages because of some new playstore regulations to which you had to answer. Actually this is quite sad. I created it with the libgdx-java library creating a nice blender to libgdx-pipeline. Even though I still have the sourcecode (somewhere) but it won't be super easy to create an apk.

But, I found it in one of those stores that release your apk without you even knowing. Now I'm thankful for that :D

WoodGames

To the game: https://apkpure.com/wood-games-3d/org.tt

And I still do love the trailer :D.

Can still remember how you did compete against a million of "cat-image-application" at these days :D Still unbelievable that you were on top of the game's category list after every update you published....but as I was saying, 1min after uploading, 10 "image"-apps (that were only showing one image rofl) kicked you out of the top10 and 10min later you were invisible again.

reminder: I really should revive some kind of games-page...

EDIT: Oh my,...I just found old stuff of wood games and even played it again, and I do love it. And I just decided...it is a shame that it is basically dead...I invested much work, fun and hate into it at these days... let's start 'Project: Revive Wood Games' even though I was planning to do something else this weekend...

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Cross-Compiling with mingw: "mingw mutex is not a member of std"

Using spdlog as logger in my current project gives me an error when I try to cross compile it using my urho3d-docker-setup:

error: 'mutex' is not a member of 'std'

After asking the internet I found out that there are actually different mingw-compilers with different suffixes:

x86_64-w64-mingw32-gcc-win32
x86_64-w64-mingw32-gcc-posix

Where the upper seems not to work with mutex. (Actually strange, I compiled lots of stuff with Urho3d and its dependencies and I would have guess those would use at some point a mutex!?)

In the end I got everything compiled using the compiler with -posix suffix. (I altered the urho3d's mingw toolchain-file...)

If you want to see all possible "alternatives" of this gcc/g++ command you can do it like this:

update-alternatives --display x86_64-w64-mingw32-g++

And you can choose one in some kind of interactive mode:

update-alternatives --config x86_64-w64-mingw32-g++

You can also set it directly like this:

update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix # posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-win32 # win32

Ref:

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

CMake: Copy files after build

If you need to e.g. bundle/copy data along your build you can use a call similar to this. Just make sure to select the target you want to 'target'.

Possible copy hooks are: PRE_BUILD | PRE_LINK | POST_BUILD

Single files

add_custom_command(
        TARGET ${PROJECT_NAME}  POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
                ${CMAKE_CURRENT_BINARY_DIR}/config/config.yaml
                ${CMAKE_CURRENT_BINARY_DIR}/bin/config/config.yaml)

Directories:

add_custom_command(TARGET ${PROJECT_NAME}  POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_directory
                ${CMAKE_CURRENT_SOURCE_DIR}/res
                ${CMAKE_CURRENT_BINARY_DIR}/res)

More read: https://cmake.org/cmake/help/v3.0/command/add_custom_command.html

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

qt-creator: make stdout work in application-output-view

I really do love qt-creator and it is my IDE of choice for c++-development. But it has here and there some flaws....beside the fact that there are not tabs to represent the opened files, one strange thing is that outputs to stdout get are not visibile immediately. I'm not 100% sure how it is triggered (maybe when the internal buffer is filled completely?).

In order to show the output directly, just add this to your main.cpp:

setbuf(stdout, NULL);

Another flaw is that from time to time you have invalid start-configs and qt-creator refuses to start your application. This is due to the path not set properly. Here helps a restart and the path is set correctly afterwards

Reference(setbuf): https://bugreports.qt.io/browse/QTCREATORBUG-3994

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

CMake Error: CMake can not determine linker language for target: [XYZ]

Just stumpled over a strange problem using CMake. A usually straight forward setup adding a 2nd executable lead to an error like this:

-- Configuring done
CMake Error: CMake can not determine linker language for target: Tests
-- Generating done

This might be related to me now using cmake 3.14 as minimum in the CMakeLists.txt-file or might be related to using CPM as CMake-internal package-manager (which requires 3.14). Not quite sure.

To make the long story short. I fixed it by adding following to the specific target:

    set_target_properties(Tests PROPERTIES LINKER_LANGUAGE CXX)

Reference: https://stackoverflow.com/questions/56462415/cmake-error-cannot-determine-link-language-for-target

Tags :

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

building qt-creator from source

Since qt-creator(4.11/4.12) integrated support for cmake's source_groups, headers and sources are split in two separate folders. 'Header-Files','Source-Files' which is a bit annoying (not so annoying as the initial lack of subfolders...). Because of that I downgraded a couple of time ago back to 4.10 till today one qt-creator issue-tracker topic was active again, what triggered me to dive in again.

To make it short, I decided to have a look if I can somehow merge both folders into one. For that I needed to be able to compile qt-creator from source-code. Which actually worked like a charme. Here the steps(hope I can recall all):

My setup: ubuntu mate/bionic

Obviously nothing is older than not maintained build instructions. These steps are valid for qt-creator 4.12 git-hash(91536ae7812e904334b0007445a64aecf3e120ad / 2020/04/23 )

  1. install qt5.12:
sudo add-apt-repository ppa:beineri/opt-qt-5.12.0-bionic
sudo apt-get update
sudo apt-get install qt512-meta-full

In order for some environment-variables to be set you have to call:

source /opt/qt512/bin/qt512-env.sh
  1. install llvm/clang-8 ( Important for c++17 features to work... )
sudo apt-get install llvm-8
sudo apt-get install libclang-8-dev
# not sure if clang-tools are needed:
sudo apt-get install clang-8 clang-tools-8
export LLVM_INSTALL_DIR=/usr/lib/llvm-8

  1. download source from git
git clone --recursive https://code.qt.io/qt-creator/qt-creator.git

# create a build-folder
mkdir qt-creator-build
cd qt-creator-build
qmake -r ../qt-creator
make -j8
  1. finished! The result is in qt-creator-build/bin

btw, in order to merge "Source-Files" and "Header-Files" you only need to alter: src/plugins/cmakeprojectmanager/fileapidataextractor.cpp (lines at about 421, I copy the whole method, but I added only the marked lines):

FolderNode *createSourceGroupNode(const QString &sourceGroupName,
                                  const FilePath &sourceDirectory,
                                  FolderNode *targetRoot)
{
    FolderNode *currentNode = targetRoot;

    if (!sourceGroupName.isEmpty()) { // new
        QString _srcgrpName = (sourceGroupName=="Header Files" || sourceGroupName=="Source Files") // new
                                ? "Source" // new
                                : sourceGroupName; // new

        const QStringList parts = _srcgrpName.split("\\"); // modified

        for (const QString &p : parts) {
            FolderNode *existingNode = Utils::findOrDefault(currentNode->folderNodes(),
                                                            [&p](const FolderNode *fn) {
                                                                return fn->displayName() == p;
                                                            });

            if (!existingNode) {
                auto node = createCMakeVFolder(sourceDirectory, Node::DefaultFolderPriority + 5, p);
                node->setListInProject(false);
                node->setIcon(QIcon::fromTheme("edit-copy", ::Utils::Icons::COPY.icon()));

                existingNode = node.get();

                currentNode->addNode(std::move(node));
            }

            currentNode = existingNode;
        }
    }
    return currentNode;
}

Hope that helps. (As always, this blog is mainly a reminder for myself. :D )

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

cmake,emscripten and c++17

Trying to compile my c++17 based project (using entt) makes problems with using my urho3d-docker-web-image that uses emscripten for compilation to web.


emcc (Emscripten gcc/clang-like replacement) 1.39.8 ((unknown revision))

Using (I'm mainly using gcc for compilation, android uses clang afaik?)

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)

leads to an error like that:


CMake Error at CMakeLists.txt:95 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 1.39.8.

I tried a couple of approaches, but the only one that worked for me was a 'brutal' add_definitions(..)


add_definitions(-std=c++1z -std=gnu++1z)

I didn't dig too deep into the problem...but for now it works... ;)

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

text(X)text or 'textX - lightweight xtext alternative for python'

Just stumpled over textX an xText inspired python-toolbox for creating DSLs. Super simple to use. I love xText but it can be really a pain in the ass here an there. Mainly because you (at least me) always forget about the internal concept and/or structure. Especially how to wire what and how to get the dependency injection working.... :D

I actually wanted to give the xText Theia-Workflow a go but instead stumpled over textX. It is a super lightweight DSL generator and AST-Parser and seems to have an addon to create Visual Studio Code addons via Language Server Protocol. Didn't tried that, yet.

A grammar would look like this (very similiar to xText):

/*
  Entity DSL grammar.
*/

EntityModel:
    types*=SimpleType       // At the beginning of model we can define
                            // zero or more simple types.
    entities+=Entity        // Each model has one or more entities.
;

Entity:
    'entity' name=ID '{'
        properties+=Property // Each entity has one or more properties.
    '}'
;

Property:
    name=ID ':' type=[Type]     // type is a reference to Type instance.
                                // There are two built-in simple types 
                                // registered on meta-model in entity_test.py
;

// Type can be SimpleType or Entity
Type:
    SimpleType | Entity
;

SimpleType:
    'type' name=ID
;

// Special rule for comments. Comments start with //
Comment:
    /\/\/.*$/
;

A sample Model using this grammar:

entity Person {
  name : string       // A comment is everything after // to the end of line
  address: Address    // It is defined by the Comment rule in the grammar
  age: integer        // integer and string are built-in objects
}                     // See entity_test.py

entity Address {
  street : string
  city : string
  country : string
}

And to let it work. This couple of lines including custom type (SimpleType),predefined data, obviously parsing and and simple generation:

from os import mkdir
from os.path import exists, dirname, join
from textx import metamodel_from_file

this_folder = dirname(__file__)


class SimpleType(object):
    def __init__(self, parent, name):
        self.parent = parent
        self.name = name

    def __str__(self):
        return self.name


def get_entity_mm():
    """
    Builds and returns a meta-model for Entity language.
    """
    type_builtins = {
            'integer': SimpleType(None, 'integer'),
            'string': SimpleType(None, 'string')
    }
    entity_mm = metamodel_from_file(join(this_folder, 'entity.tx'),
                                    classes=[SimpleType],
                                    builtins=type_builtins)

    return entity_mm


def main(debug=False):

    # Instantiate the Entity meta-model
    entity_mm = get_entity_mm()

    def javatype(s):
        """
        Maps type names from SimpleType to Java.
        """
        return {
                'integer': 'int',
                'string': 'String'
        }.get(s.name, s.name)

    # Create the output folder
    srcgen_folder = join(this_folder, 'srcgen')
    if not exists(srcgen_folder):
        mkdir(srcgen_folder)

    # Build a Person model from person.ent file
    person_model = entity_mm.model_from_file(join(this_folder, 'person.ent'))

    # Generate Java code
    for entity in person_model.entities:
        # For each entity generate java file
        with open(join(srcgen_folder,
                      "%s.java" % entity.name.capitalize()), 'w') as f:
            f.write("%s.java" % entity.name)


if __name__ == "__main__":
    main()

Would have to port my own templating engine, but I guess with python that would be super easy. Definitely interesting...

More examples: https://github.com/textX/textX/tree/master/examples
Documentation: http://textx.github.io/textX/stable/

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

git: get short hash of remote repo

Atm I'm maintaining my urho3d-minimal-new-project to use the latest version of urho3d in its docker-images. To make this a smoother 'one-click' process I want the new docker-images to have an additional flag like 'githash-$HASH' where the $HASH is the current short-version of the urho3d's git-HEAD. Based on this stackoverflow post:


git ls-remote  https://github.com/urho3d/Urho3D.git HEAD | awk '{ print substr($1,1,10) }'

This will get the first 10 chars of the long-hash. That should be enough. Be aware that the uniqueness of the short-hash depends on the size of the project. Here some hint this git doc:

Generally, eight to ten characters are more than enough to be unique within a project. For example, as of February 2019, the Linux kernel (which is a fairly sizable project) has over 875,000 commits and almost seven million objects in its object database, with no two objects whose SHA-1s are identical in the first 12 characters.

Tags : ,

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!

Multimonitor-Setup mit 4k and HD

Ubuntu Mate: Since I have a 4k monitor I want to get both monitors to be scaled accordingly. I had to increase the dpi on the 4k which resulted in too big fonts on the HD-Monitor. Now I found a way to set this up right base on one forum-entry . (Thx to user: dglt)

In my setup I set the font dpi to 125 and set scale for the HD-Monitor to 1.3x1.3. I actually don't know why higher numbers means to zoom out more but I didn't read too much about xrandr at all:

sudo xrandr --output HDMI-1 --auto --scale 1.3x1.3 --output HDMI-0 --auto --scale 1.0x1.0 --left-of HDMI-1

To check the monitor name, you can use:

xrandr --listmonitors 

One way to make it permanent you can create a .desktop file which will be executed on startup put it here:
/usr/local/share/display-scale.desktop

[Desktop Entry]
Type=Application
Name=Set xrandr display scale
Exec=sh -c "xrandr --output HDMI-1 --auto --scale 1.3x1.3 --output HDMI-0 --auto --scale 1.0x1.0 --left-of HDMI-1"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

Last thing to do to create 2 sym-links in some other autostart-locations:

sudo ln -s /usr/local/share/display-scale.desktop /usr/share/gdm/greeter/autostart/display-scale.desktop
sudo ln -s /usr/local/share/display-scale.desktop /etc/xdg/autostart/display-scale.desktop
Tags : ,

Export this post as PDF document  Export this post to PDF document

Social Bookmarks :  Add this post to Slashdot    Add this post to Digg    Add this post to Reddit    Add this post to Delicious    Add this post to Stumble it    Add this post to Google    Add this post to Technorati    Add this post to Bloglines    Add this post to Facebook    Add this post to Furl    Add this post to Windows Live    Add this post to Yahoo!
<< Previous | Home | Next >>