Giter VIP home page Giter VIP logo

oxygine-framework's Introduction

BUILD AND RUN

See oxygine-framework/readme/ folder. It has instructions on how to build and run oxygine on different platforms.

Wiki available at

https://github.com/oxygine/oxygine-framework/wiki

Oxygine is a C++ engine for 2D mobile games.

Yet another shell around OpenGL/D3D API you would say? No, this is a set of classes and tools to create a game according to your requirements.

At the basis of the engine there is a scene graph, that is similar to Flash. In short, You can call this as Flash for C++, but more comfortable and way faster. Initially it was developed for mobile platforms (iOS, Android), but can also be used for PC games.

Source code is available under MIT license (use for free anywhere).

SDK includes:

  • Source code, libraries
  • Necessary tools, documentation
  • Examples
  • Demo for testing and demonstration of base features

Supported platforms:

  • Android
  • iOS
  • Windows
  • MacOSX
  • Emscripten (web)

Examples of code:

//create sprite and display it
spSprite sprite = new Sprite();
sprite->attachTo(getStage());

//run animation tween
sprite->addTween(Sprite::TweenAnim(gameResources.getResAnim("anim2")), duration, loops);

//run position tween
sprite->addTween(Sprite::TweenPosition(x, y), duration, loops);

//handle click event
sprite->addEventListener(TouchEvent::CLICK, [sprite](Event*){
    
    log::messageln("clicked to sprite!");
    //change sprite color
    sprite->setColor(Color::Gray);
});

Features:

  • Programming language is C++.
  • For rendering OpenGL(ES) 2.0 is used. Custom shaders supported.
  • Compressed textures supported.
  • Component based system, simple and predictable OOP API. Possibility to inherit from classes and overload their behavior.
  • No global mega managers of everything, that dictate the requirements and the way you write your code.
  • Effective and flexible work with resources, very close to your game.
  • Components of the engine have weak links between each other. Can be used together, separately or not at all.
  • Fast creation and deletion of objects using memory pools for all engine objects.
  • SceneGraph is somewhat similar to Flash (diagrams with inheritance models). It is built on smart pointers (analogue boost:intrusive_ptr). No need to hassle with memory control, memory leaks.
  • Debug Tools (screenshot). Tree Inspector is “Visual profiler” for Scene Graph. Right in the game you can view the graph and different branches to analyze and errors search. “Textures Inspector” shows you currently loaded textures into memory (screenshot)
  • Render to texture.
  • Resources description is stored in xml file. It has multiple different parameters: you can add your own resources types, format can be set, in which you will store the texture(atlas) in memory, number of columns and rows for animation, etc. Any resource can have user-data attributes.
  • Tweens for frame-by-frame animation, color, position, rotation, etc. Easily create your own.
  • A set of basic UI components commonly used in games: Button, Sprite, ProgressBar and others (image) Command-line tool on Python to process your resources: Build you resources from XML files into atlases, determining the optimal size of atlases. Resize assets from high-res to necessary for your game. Does additional work to optimize work with resources in the game. Compress automatically to ETC1 or PVRTC textures format.
  • Well-designed handling of events from mouse and multi-touch (for example you can press two buttons with two fingers at the same time without collisions) based on AS3 Flash model.
  • It is possible to write code and dialogs in blocking style (concurency programming/coroutines).
  • Accurate rendering of text with line-wraps, vertical and horizontal alignment support, localization, utf-8. Base HTML tags support (screenshot).
  • If you want to add multiple sets of assets for different game resolutions it can be done on the engine level by writing just a few lines of code. You won’t need to adjust coordinates manually for different resolution. It is enough just to keep initial art in high-res.
  • Masking (screenshot, screenshot)
  • Atlas assembling on the fly during the loading, if you didn't provide it yourself.
  • Multi-threaded resources loading.
  • It is possible to partially unload “heavy” resources like atlases from memory. The resouce handle to work with atlas will be still valid (as well as its size) and will even have texture points, but the texture itself will be empty. This is very important when you have strict memory limitations: for example if you created the whole UI with all resources loaded, but there is no need to display them all at once.
  • Fast automatic batching.
  • Bitmap fonts based on BMFont and FreeType. Possibility to add your own font type.

You could build it on top of Marmalade, SDL2 or adapt it for your platform. Oxygine can be built with Emscripten for internet browsers as well.

And this is not everything. There are a lot of easy-to-use features, this framework is not a monster and is clear and intuitive. Viewing a couple of examples is enough to understand how it works.

Contacts

You can find more information at oxygine.org

oxygine-framework's People

Contributors

abanink avatar akk0rd87 avatar basiliscos avatar berinhardt avatar borchbruevich avatar dpmkl avatar frankinshtein avatar holoeye-photonics avatar jordan-woyak avatar neo7k avatar otraore avatar pscamman avatar ptdave20 avatar radonthetyrant avatar robhshu avatar taymindis avatar tony avatar yahor10 avatar zmeyc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oxygine-framework's Issues

Compilation under Linux should use pkg-config

Compilation under Linux should ideally use pkg-config to find include directories and compiler options.
CMake 2.6 provides a script with a function, pkg_search_module, to interface easily with pkg-config.

For instance, I'm under fedora and compilation fails, simply because in fedora, they bundled SDL2 and SDL2main in one archive file, thus only "-lSDL2" should be passed to the compiler and passing "-lsdl2main" provokes an error. Besides they use capital letters.

% pkg-config sdl2 --libs
-lSDL2 -lpthread 

I'm investigating on how to fix it.

Error cast from void*’ to ‘int’ loses precision in OpenGL Test

Problem with compile on Ubuntu 'gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) '

oxygine/oxygine-framework/examples/Demo/src/TestOpenGL.h:95:63: error: cast from ‘oxygine::nativeTextureHandle {aka void*}’ to ‘int’ loses precision [-fpermissive]
         int texture = (int)frame.getDiffuse().base->getHandle();

Solution:
intptr_t texture = reinterpret_cast<intptr_t>(frame.getDiffuse().base->getHandle());

Casting to intptr_t type. It's an int type guaranteed to be big enough to contain a handle.

EDIT. same problem on mac and ios

HelloWorld example fails at linker stage

From master revision: 49ab35f81b79eef03264f2f621fe20cd7a8bf320
System: MacOS Sierra 10.12.6
Compiler: Apple LLVM version 8.1.0 (clang-802.0.42)

When running:

cd oxygine-framework/examples/HelloWorld/proj.cmake
./run.sh

I get the following linker error:

[100%] Linking CXX executable HelloWorld
Undefined symbols for architecture x86_64:
  "oxygine::iosNavigate(char const*)", referenced from:
      oxygine::core::execute(char const*) in liboxygine-framework.a(oxygine.cpp.o)
  "oxygine::iosGetMemoryUsage(unsigned long&)", referenced from:
      oxygine::DebugActor::render(oxygine::RenderState const&) in liboxygine-framework.a(D
ebugActor.cpp.o)
  "oxygine::iosGetFreeDiskspace()", referenced from:
      oxygine::getFreeSpace(char const*) in liboxygine-framework.a(oxygine.cpp.o)
  "oxygine::file::getSupportFolder()", referenced from:
      oxygine::file::init(char const*, char const*) in liboxygine-framework.a(file.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [HelloWorld] Error 1
make[1]: *** [CMakeFiles/HelloWorld.dir/all] Error 2
make: *** [all] Error 2
./run.sh: line 16: ./../proj.cmake/build/HelloWorld: No such file or directory
jake@Jacobs-MacBook-Pro:~/workspace/maze_maker/oxygine-framework/examples/HelloWorld/proj.

setSize cause click bugs

Hello,
When I call setSize in a Button and setResAnim, eg.

        spButton btn = new Button;
        btn->setPosition(200, 300);
	btn->setResAnim(res.getResAnim("frame-1"));
	btn->setSize(Vector2(200, 200));
        btn->attachTo(_view);

The button can't click anymore!

The size of frame-1.png is 1100 x 868
The oxyengine-framework is the newest version cloned from master

Can I setSize with any value I want please? Thanks in advanced.

Emscripten build uses SDL version 1, but why?

Unless you specify "-s USE_SDL=2" it uses SDL version 1.
When i pass USE_SDL=2 then input is not working (keyboard, touch).

I wanted to include SDL_net, that is why i am asking. I am not sure that using SDL 1 is the way.

Is it possible to add tint?

Hi, @frankinshtein

Is there a way to tint a sprite with color?
I've tried VStyleActor::setColor - it works but colors are blended.
What I want to achieve is to save source texture alpha and apply tint colour over it without blending colors.

Investigate better distribution method

according to @frankinshtein via chat, there is an important point of oxygine being able to do all-in-one bundles. I agree that they are very convenient and we should keep them. Many open source projects have pre-built builds automatically generated via scripts

The issue is currently there isn't enough distinction between distribution infrastructure meant to be helpful to newcomers and how the many ways oxygine can be implemented from scratch.

My current issues are three things:

  1. Including pre-built libs in the version control itself (e.g. https://github.com/oxygine/oxygine-framework/tree/master/oxygine/third_party/win32), it's never considered a good practice. It shifts the burden to the project maintainers to caretake built versions of external libraries.

    pros:

    • especially for examples and trying the library out (which is good, we want that.)
    • libraries are pre-built and should ideally just run

    cons:

    • takes up space in the main repo (see #72).
    • make things harder for developers in custom cases. If pre-built binaries are not suitable for how they intend on deploying it (they may have another library they incorporate that's ABI incompatible) it can be more confusing for them.
    • even for examples, its hard to have 100% assurance without CI that a user will have the example "just work".
  2. Directories where we have pre-built project files in the repo. (e.g. https://github.com/oxygine/oxygine-framework/tree/master/examples/DemoBox2D,

    pros:

    • user can immediately open a project and build/run it xcode, visual studio, etc

    cons:

    • when project files are pre-built, its not easy to know for sure they'll work across a wide variety of system settings, IDE settings, OS versions, IDE versions. Even in my case many of the examples currently break on OS X.
    • it increases the developer burden to maintain them and assure it works across those systems
    • it places the project files in the main repo

    If there is an insistence for providing project files, such as for examples, there are tools like CMake which generate XCode and Visual Studio project files. The project files themselves shouldn't be in the main repository. There should be tools generate them dynamically.

  3. Pre-built project files and libraries don't facilitate library users

    In any game that gets to even medium complexity, the libraries and project files that are included in the repo will not match the needs of the developer.

    In many cases, I feel a tutorial on how to create a blank oxygine project in Visual Studio, CLion, Xcode, terminal (vim/emacs and cmake) may be better pre-made project files. In bsd, linux and OS X, most of oxygine's dependencies (sdl2, libpng, libjpeg, etc.) can be grabbed from package managers (pkg, ports, apt, yum, brew). My PR's at #29, #30, #31, #35 are designed to better locate libs across these platforms and use them. This shifts the burden of the libraries (as I think it should be) to the developer and the system they're building on.

    A place where I could use help, #49, is NuGet. As I do not have as much experience with windows.

Separate examples into separate repo

Situation:

  • I want to use oxygine as a submodule for a project
  • As of ecbbcfc, the repo is 141.14mB

I want to be able to include the project by source without any pre-built files or examples.

Any opinion to creating a oxygine-examples repo for that? If so, I could separate examples/ into it and use git filter-branch to preserve the history.

Are you open to doing a rewrite --force on this repo to remove examples to make the repo lighter? ATM there is only 486 commits and less than 30 issues. IMO its better to have a pristine repo and do this early on.

Cannot compile project for Linux x64

nativeTextureHandle (that is declared in NativeTexture.h) is typedef to void* and is casted to uint in some places. Here issues on 64 bit platform come out: void* is 8 bytes length and uint is 4 bytes. When casting void* to uint on x64 platform gcc gives error about losing integer precision.

Wrong text positioning?

Hi, @frankinshtein

Working with TTF fonts in Oxygine.
Looks like text positioning is wrong, but text rect calculation is correct.
I'd say that font's descent is ignored.
Please look at screenshot.

screen shot 2017-12-04 at 21 55 01

Code for drawing text and red rectangle:

_textfield->setSize(getSize()); // <-- size of white background

const Rect& rect = _textfield->getTextRect(); // <-- rect of red overlay
_textrect->setPosition(rect.pos);
_textrect->setSize(rect.size);

Box2d Debug Draw Crashes Oxygine

I was Playing around with the debug draw of the DemoBox2d example and when you have the debug draw active and press on the tree it will crash the game and throw an exception.

Way to reproduce:

  • click on the debug draw button
  • go to oxygine debug tools in top left
  • click on the tree inspector

No emscripten example?

I'm mainly interested in html5 as a target. I don't see any emscripten example in the sample projects, as the wiki says should be there.

Resources::get can miss resources because of lower_bound

In Resources.cpp
In function Resources::get

std::lower_bound is used, but the range for it is [first, last) meaning that it can miss the last item.
If this is changed to a normal search like below, then it finds the last item

for (auto it = _fastAccessResources.begin(); it != _fastAccessResources.end(); ++it)
{
    if ((*it)->getName() == id)
        return (*it).get();
}

File is saved to a different directory

I am not sure if I am just missing something, but when I open a file, modify it and save it back it is saved into the data-ram folder instead of the standard working directory.

Also when I create new file using write function I cannot read it back again after relaunching the game, because it reads data from the working directory but file was save into the data-ram folder. How can I solve this?

Question: Is there a way to stop all animation

Hi, @frankinshtein

When mobile app goes to background, animation stops at some point. When app is restored, animation resumes from exact same time and position.
Is there a way not to stop animation's clock (or reset all tweens as workaround)?
What I want to achieve is to not to keep active animations while app is in background but complete/cancel them.

UPD:
I've added a method to Actor and call it on Stage::onDeactivate.

void Actor::complete()
{
    removeTweens(true);

    spActor child = getFirstChild();
    while (child)
    {
        child->complete();
        child = child->getNextSibling();
    }
}

libpng error on Linux Mint 17.2 Rafaela

I got this error

--
-- found
-- SDL includes: /usr/local/include/SDL2
-- Libs: oxygine-framework;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libSM.so;/usr/lib/x86_64-linux-gnu/libICE.so;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;SDL2main;SDL2;pthread;png;jpeg;z
-- Platform: linux
-- Configuring done
-- Generating done
-- Build files have been written to: /home/baykan/oxygine/oxygine-framework/examples/HelloWorld/proj.cmake/build
[ 99%] Built target oxygine-framework
Linking CXX executable HelloWorld
oxygine-framework/liboxygine-framework.a(Image.cpp.o): In function oxygine::_initWithPngData(oxygine::Image&, void*, int, bool, oxygine::TextureFormat)': Image.cpp:(.text+0x817): undefined reference to png_set_longjmp_fn'
collect2: error: ld returned 1 exit status
make[2]: *** [HelloWorld] Hata 1
make[1]: *** [CMakeFiles/HelloWorld.dir/all] Hata 2
make: *** [all] Hata 2
./run.sh: 16: ./run.sh: ./../proj.cmake/build/HelloWorld: not found

Does Oxygine have support with mobile web?

I run build_emsc.bat inside example/xxx/proj.cmake and generate xxx.js & xxx.html.

And I check xxx.js. There is no touch_start event. So, mobile web isn't supported?

All buttons of demo can't be triggered on Chrome for Android or Firefox on Android.

Thanks.

Input Text Demo not Rendering

The text on the input text demo isn't rendering. I noticed the text is getting captured and set but it's not rendering correctly for some reason. I'm trying to figure out the problem but I've only started to use oxygine and only have a basic knowledge of C++ so I don't know how quick I'll figure it out.

HttpRequestTask segment fault on Example Demo, execute run from proj.cmake folder

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
build settings
initialize oxygine
SDL build
creating window 960 640
display size: 960 640
ZipFS, total files: 13
oxygine initialized
DebugActor::initialize
ZipFS, total files: 13

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x000000000053cbab in oxygine::HttpRequestTask::create() ()
#2 0x00000000005548ec in oxygine::WebImage::load(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) ()
#3 0x000000000052819b in Test::init() ()
#4 0x00000000004f94ae in example_init() ()
#5 0x0000000000527d8e in run() ()
#6 0x0000000000527e27 in main ()

Text on buttons disappearing sometimes.

On the demo website http://oxygine.org/online_demo.php
When i start Demo (the second one), then i select Performance, and then push Animate button several times, the text will disappear. I have seen multiple places with empty green buttons, i think there should be text on most of them.
(Linux 64bit / Chrome Version 49.0.2623.110 (64-bit))

SQLite3 and GUI?

Hey, i'm quite beginer in code (i've already tried .lua (love), and game maker). Here i want to make a fun database.
Is it possible to integrate sql database with oxygine and some one does already made a GUI ? :)

Fix the wiki formatting?

Pretty much every page in the wiki is filled with broken markdown formatting, primarily in the headings and URLs

Oxygine + boost::asio

Hello!
I am using Oxygine and boost::asio and getting strange compiler errors that depend on the order of #include statements

include oxygine-framework.h

include boost/asio.hpp

// Works good

include boost/asio.hpp

include oxygine-framework.h

// Generates errors

Errors are following:
...\oxygine-framework\oxygine\src\Event.h(94): error C2332: 'enum' : missing tag name
...\oxygine-framework\oxygine\src\Event.h(94): error C2059: syntax error : 'constant'
...\oxygine-framework\oxygine\src\Event.h(94): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
...\oxygine-framework\oxygine\src\Event.h(100): error C2059: syntax error : 'constant'
...\oxygine-framework\oxygine\src\Event.h(100): error C2065: 'k' : undeclared identifier
...\oxygine-framework\oxygine\src\Event.h(100): error C2065: 'd' : undeclared identifier

I tried searching for common #defines, but except OUT didnt find a lot. Can you check it out please?

Emscripten build problems

Could not compile with Emscripten, here are the details:
Any idea what is wrong?

(Same program compiles and runs fine when compiling with gcc to linux)
Also the release build is working as expected.

compile log:

[100%] Linking CXX executable HelloWorld.html
WARNING:root:emcc: cannot find library "nul"
warning: emitted code will contain very large numbers of local variables, which is bad for performance (build to JS with -O2 or above to avoid this - make sure to do so both on source files, and during 'linking')
warning: unresolved symbol: _ZN7oxygine5ActorD2Ev
warning: unresolved symbol: _ZN7oxygine10RestorableD2Ev
warning: unresolved symbol: _ZN7oxygine8ResourceD2Ev
warning: unresolved symbol: _ZN7oxygine5ActorC2Ev
warning: unresolved symbol: _ZN7oxygine11VStyleActorC2Ev
warning: unresolved symbol: _ZN7oxygine6SpriteD2Ev
warning: unresolved symbol: _ZN7oxygine10ObjectBaseD2Ev
[100%] Built target HelloWorld

console error log:

HelloWorld.html:1249 pre-main prep time: 136 msModule.printErr @ HelloWorld.html:1249
HelloWorld.html:1237 initialize oxygine
HelloWorld.html:1237 EMSCRIPTEN build
HelloWorld.html:1237 display size: 960 640
HelloWorld.html:1237 ZipFS, total files: 13
HelloWorld.html:1237 oxygine initialized
HelloWorld.html:1237 ZipFS, total files: 13
HelloWorld.html:1249 missing function: _ZN7oxygine6SpriteD2EvModule.printErr @ HelloWorld.html:1249
HelloWorld.html:1237 -1
HelloWorld.html:1249 -1Module.printErr @ HelloWorld.html:1249
HelloWorld.html:1249 warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demanglingModule.printErr @ HelloWorld.html:1249
HelloWorld.js:313372 Uncaught abort(-1) at Error
    at jsStackTrace (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:1134:13)
    at stackTrace (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:1151:22)
    at abort (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:313477:44)
    at __ZN7oxygine6SpriteD2Ev (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:8105:67)
    at __ZN7oxygine12MaskedSpriteD2Ev (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:187623:2)
    at Array.__ZN7oxygine12MaskedSpriteD0Ev (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:187633:2)
    at __ZN7oxygine11ref_counter10releaseRefEv (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:14819:30)
    at Array.__ZN7oxygine21intrusive_ptr_releaseEPNS_11ref_counterE (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:14796:2)
    at Object.dynCall_vi (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:310134:32)
    at invoke_vi (file:///home/jsaak/svn/jsaak/dyna/proj.cmake/build_emsc/HelloWorld.js:9061:25)

emsdk:

$ ./emsdk list     

The following precompiled tool packages are available for download:
           node-4.1.1-32bit         
    (*)    node-4.1.1-64bit             INSTALLED
           emscripten-1.30.0        
           emscripten-1.34.1        
           emscripten-1.35.0        

The following tools can be compiled from source:
           clang-tag-e1.36.4-32bit  
           clang-tag-e1.36.5-32bit  
           clang-tag-e1.36.4-64bit  
           clang-tag-e1.36.5-64bit  
           clang-incoming-32bit     
           clang-incoming-64bit     
           clang-master-32bit       
    (*)    clang-master-64bit           INSTALLED
           emscripten-tag-1.36.4-32bit
           emscripten-tag-1.36.5-32bit
           emscripten-tag-1.36.4-64bit
           emscripten-tag-1.36.5-64bit
           emscripten-incoming-32bit
           emscripten-master-32bit  
           emscripten-incoming-64bit
    (*)    emscripten-master-64bit      INSTALLED

The following precompiled SDKs are available for download:

The following SDKs can be compiled from source:
         sdk-incoming-32bit       
         sdk-incoming-64bit       
         sdk-master-32bit         
    *    sdk-master-64bit           INSTALLED
         sdk-tag-1.36.4-32bit     
         sdk-tag-1.36.5-32bit     

Items marked with * are activated for the current user.
Items marked with (*) are selected for use, but your current shell environment is not configured to use them. Type "source ./emsdk_env.sh" to set up your current shell to use them.

To access the historical archived versions, type 'emsdk list --old'

HttpRequestTask crash

In HttpRequestTask static initializer, autoreleased session object is not retained and assigned to plain C++ pointer.
If HttpRequestTask instance is not started instantly, the session is destroyed on next loop of event loop, which leads to crash when trying to start the task.
Fix: Retain/release the task as appropriate.

Unresolved externals after update

Hello! I updated oxygine to the latest version and faced a couple of unresolved external errors:

oxygine_vs2013_d.lib(TextField.obj) : error LNK2019: unresolved external symbol "public: __thiscall oxygine::TextRenderer2::TextRenderer2(class oxygine::STDRenderer *)" (??0TextRenderer2@oxygine@@QAE@PAVSTDRenderer@1@@z) referenced in function "public: virtual void __thiscall oxygine::TextField::doRender(class oxygine::RenderState const &)" (?doRender@TextField@oxygine@@UAEXABVRenderState@2@@z)

1>oxygine_vs2013_d.lib(Stage.obj) : error LNK2019: unresolved external symbol "public: __thiscall oxygine::STDRenderer::STDRenderer(class oxygine::IVideoDriver *)" (??0STDRenderer@oxygine@@QAE@PAVIVideoDriver@1@@z) referenced in function "public: void __thiscall oxygine::Stage::render(class oxygine::Color const &,class oxygine::RectT<class oxygine::VectorT2 > const &)" (?render@Stage@oxygine@@QAEXABVColor@2@ABV?$RectT@V?$VectorT2@H@oxygine@@@2@@z)

1>oxygine_vs2013_d.lib(TreeInspectorPreview.obj) : error LNK2001: unresolved external symbol "public: __thiscall oxygine::STDRenderer::STDRenderer(class oxygine::IVideoDriver *)" (??0STDRenderer@oxygine@@QAE@PAVIVideoDriver@1@@z)

1>oxygine_vs2013_d.lib(Node.obj) : error LNK2019: unresolved external symbol "public: void __thiscall oxygine::TextRenderer2::draw(class oxygine::AffineTransformT const &,class oxygine::intrusive_ptr,unsigned int,class oxygine::RectT<class oxygine::VectorT2 > const &,class oxygine::RectT<class oxygine::VectorT2 > const &)" (?draw@TextRenderer2@oxygine@@QAEXABV?$AffineTransformT@M@2@V?$intrusive_ptr@VNativeTexture@oxygine@@@2@IABV?$RectT@V?$VectorT2@M@oxygine@@@2@2@Z) referenced in function "public: virtual void __thiscall oxygine::text::TextNode::draw(class oxygine::text::DrawContext &)" (?draw@TextNode@text@oxygine@@UAEXAAVDrawContext@23@@z)

1>oxygine_vs2013_d.lib(MaskedSprite.obj) : error LNK2019: unresolved external symbol "public: __thiscall oxygine::MaskedRenderer::MaskedRenderer(class oxygine::intrusive_ptr,class oxygine::RectT<class oxygine::VectorT2 > const &,class oxygine::RectT<class oxygine::VectorT2 > const &,class oxygine::AffineTransformT const &,bool)" (??0MaskedRenderer@oxygine@@QAE@V?$intrusive_ptr@VNativeTexture@oxygine@@@1@ABV?$RectT@V?$VectorT2@M@oxygine@@@1@1ABV?$AffineTransformT@M@1@_N@Z) referenced in function "protected: virtual void __thiscall oxygine::MaskedSprite::render(class oxygine::RenderState const &)" (?render@MaskedSprite@oxygine@@MAEXABVRenderState@2@@z)

Can you help me resolve it?

Multitouch problems

Touches aren't deregistering sometimes because of a bug in touch lookup function, which leads to possibility of different touches to have same touch index (1) after some time.

Nuget to manage windows dependencies?

Discussed this a bit with @frankinshtein via chat. I'd like to simplify the build process while still making things convenient as possible for those who use all-in-one bundles (which include SDL2 pre-built).

NuGet would require that nuget is installed and would need to grab packages from the internet. Most open source software projects will grab dependencies from the internet anyway (Gemfile, package.json, bower.json, requirements.txt). However, I am new to deploying windows applications and not sure if this holds true with Windows library dependencies.

Can anyone here developing with oxygine on windows provide feedback? Anyone here use SDL2 on windows and could provide some details on how they manage library dependencies?

Bubbling in touch events

On iOS simulator TOUCH_UP and MOVE events are emitted once, but TOUCH_DOWN is emitted twice (with bubbling: true, then bubbling: false).

TOUCH_DOWN: bubbles=1
TOUCH_MOVE: bubbles=1
TOUCH_MOVE: bubbles=1
TOUCH_MOVE: bubbles=1
TOUCH_UP: bubbles=1
TOUCH_UP: bubbles=0

Steps to reproduce:

    _holder->addEventListener(TouchEvent::TOUCH_UP, CLOSURE(this, &GameScene::onTouchEvent));
    _holder->addEventListener(TouchEvent::MOVE, CLOSURE(this, &GameScene::onTouchEvent));
    _holder->addEventListener(TouchEvent::TOUCH_DOWN, CLOSURE(this, &GameScene::onTouchEvent));

void GameScene::onTouchEvent(Event *ev)
{
    if (ev->type == TouchEvent::TOUCH_DOWN)
        log::messageln("TOUCH_DOWN: bubbles=%d", (int)ev->bubbles);
    else if (ev->type == TouchEvent::MOVE)
        log::messageln("TOUCH_MOVE: bubbles=%d", (int)ev->bubbles);
    else if (ev->type == TouchEvent::TOUCH_UP)
        log::messageln("TOUCH_UP: bubbles=%d", (int)ev->bubbles);
}

Allow disabling caches in HttpRequestCocoaTask

HTTP cache is disabled when downloading files, but for normal requests results are cached. I suggest adding an option to use ephemeralSessionConfiguration in this case as well.
Also, session is created in two places, consider merging them into one.

HTTP Request segmentation faults on Demo example

Just poking around and trying Oxygine to see if it will work for a game I've been wanting to make. While poking around on the Demo project, the application crashed whenever the HTTP Request option was selected. The error given in my terminal upon crash was:

error: Assert! _ptr && _ptr->_ref_counter > 0 in /home/aargonian/Development/Languages/C++/Cloned/oxygine-framework/oxygine/src/core/intrusive_ptr.h:42

I'm running on Ubuntu 16.04. GCC/G++ Version 5.4.0, Kernel 4.4.0 and I was compiling using the proj.cmake method and the run.sh shell script. Let me know if I can provide any additional information.

Crash on Android when activity recreated

Hi, @frankinshtein

Steps are fairly simple:

  1. Enable "Do not keep activities" flag.
  2. Minimize application (I tested on several projects, including HelloWorld from examples)
  3. Restore
  4. Repeat steps 2- 3 several times
    Note: better reproducible when tap on "Recents", not "Home"

What seems take place:

  1. SDL sends SDL_WINDOWEVENT_MINIMIZED/SDL_WINDOWEVENT_FOCUS_LOST/SDL_QUIT almost instantly, because SDLActivity got destroyed right after paused/stopped.
  2. Oxygine calls reset() / release()
    Note: process is alive, static still in memory
  3. When app restored, there is a message in log
error: Assert! i == _restorable.end() in oxygine-framework/oxygine/src/core/Restorable.cpp:88
  1. After several times app sent to background/restored, crash occurs
Fatal signal 11 (SIGSEGV), code 2, fault addr 0xa0c3add4 in tid 17277 (SDLThread)

Crashed: ru.zw9.testcpp|
0  libandroid-lib.so              0xb41139f4 (Missing)
1  libgame-lib.so                 0xa0c82dc1 oxygine::Restorable::releaseAll() (Restorable.cpp:55)
2  libgame-lib.so                 0xa0c86b57 oxygine::core::reset() (oxygine.cpp:562)
3  libgame-lib.so                 0xa0c62643 oxygine::EventDispatcher::dispatchEvent(oxygine::Event*) (closure_impl.h:60)
4  libgame-lib.so                 0xa0c59395 oxygine::Actor::dispatchEvent(oxygine::Event*) (Actor.cpp:386)
5  libgame-lib.so                 0xa0c871cf oxygine::core::SDL_handleEvent(SDL_Event&, bool&) (oxygine.cpp:720)
6  libgame-lib.so                 0xa0c8737b oxygine::core::update() (oxygine.cpp:841)
7  libgame-lib.so                 0xa0c561fd mainloop() (main.cpp:25)
8  libgame-lib.so                 0xa0c56449 run() (main.cpp:120)
9  libgame-lib.so                 0xa0c56553 SDL_main (main.cpp:181)
10 libgame-lib.so                 0xa0d0fd81 Java_org_libsdl_app_SDLActivity_nativeRunMain (SDL_android.c:460)
11 base.odex                      0xa1e9b995 oatexec
12 base.odex                      0xa1ea55c9 oatexec
13 system@[email protected]      0x732798d1 oatexec

Will appreciate any advice!

UPD:
I've added the following method and call it from oxygine::release() and crash gone.

void Restorable::unregAll()
{
    MutexAutoLock al(_mutex);
    auto it = _restorable.begin();
    while(it != _restorable.end()) {
        it = _restorable.erase(it);
    }
}

Demo Dlls

In the visual studio .readme it this is stated :

  • copy
    all required dlls from oxygine-framework\oxygine\third_party\win32\dlls
    and SDL2.dll from SDL\VisualC\SDL\Win32\ or
    to oxygine-framework\examples\Demo\data\

The actual folder I had to place the Dll's in was this :
oxygine-framework\examples\Demo\proj.win32\Debug

Maybe this is intended, or could this be because of upgradinbg the VS10 solution to VS12 ?

Crash on iOS when swiping app out

Hi, @frankinshtein !

There is a crash on iOS when using OXYGINE_DEBUG_TRACE_LEAKS.
It occurs each time when app is swiped out from tasks.

4  game                           0x1013d4ea8 oxygine::ObjectBase::__removeFromDebugList(oxygine::ObjectBase*) + 932
5  game                           0x1013d54c0 oxygine::ObjectBase::~ObjectBase() + 216
6  game                           0x10129c2f0 oxygine::Object::~Object() + 40
7  game                           0x1015a184c oxygine::ShaderProgram::~ShaderProgram() + 36
8  game                           0x1015a1938 oxygine::ShaderProgramGL::~ShaderProgramGL() + 136
9  game                           0x1015a1974 oxygine::ShaderProgramGL::~ShaderProgramGL() + 28
10 game                           0x1015a19dc oxygine::ShaderProgramGL::~ShaderProgramGL() + 28

I've managed to catch it in Xcode debugger

if (_tracingLeaks)
{
    MutexAutoLock m_(getMutex());
    if (base->__traceLeak)
    {
        base->__traceLeak = false;
        __createdObjects& objs = __getCreatedObjects();
        __createdObjects::iterator i = std::find(objs.begin(), objs.end(), base);
        OX_ASSERT(i != objs.end());  // <-- That line
        objs.erase(i);
    }
}

UPD: maybe its on my side, didn't notice it on example projects..

AsyncTask isn't destroyed in HttpRequestTask

AsyncTask seems to be never destroyed in HttpRequestTask when _mainThreadSync is true. HttpRequestTask is created like this:

    spHttpRequestTask task = HttpRequestTask::create();
    task->setUrl(url);
    task->run();

"Assertion `!"handleErrorPolicy error."' failed" on Fedora 21

Hi,

I tried to run the HelloWorld example, and I got this:
/home/$USER/oxygine-framework/oxygine/src/core/oxygine.cpp:919: void oxygine::handleErrorPolicy(oxygine::error_policy, const char*, ...): Assertion `!"handleErrorPolicy error."' failed.

However, oxygine and HelloWorld build sucessfully with cmake on my Fedora 21.

Fix include of jnihelper.h

Building does not work on case sensitive file systems because these files refer to "jnihelper.h" instead of "jniHelper.h":

oxygine/src/core/android/jniUtils.h
oxygine/src/core/android/jniUtils.cpp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.