Combine with Tangram-ES

Combine with Tangram-ES
0.0 0


I trying to implementing Cocos2D-X (C++) with Tangram-ES [C++].

This Code works, but very strange.
If i loaded them, it works generally ok, it shown me the result from Tangram.
But the problems are:

  • if i hover the app with the mouse it’s switching in black screen in the time im hovering it
  • No Cocos Nodes (Menu etc.) are shown in this time

This is the Class for the Tangram:

void MapScene::create() {
	if(!map) {
		platform = std::make_shared<Tangram::LinuxPlatform>();
		map = new Tangram::Map(platform);
		map->loadSceneAsync("Resources/scene.yaml", true, {}, nullptr, {});
	mWindow = glfwGetCurrentContext();
	if(!mWindow) {
	int fWidth = 0, fHeight = 0;
	glfwGetWindowSize(mWindow, &fWidth, &fHeight);
	framebufferResizeCallback(mWindow, fWidth, fHeight);
	lastTime = glfwGetTime();

void MapScene::update(float dt) {

	// Poll for and process events
	if(platform->isContinuousRendering()) {
	} else {

void MapScene::framebufferResizeCallback(GLFWwindow* mWindow, int fWidth, int fHeight) {
	int wWidth = 0, wHeight = 0;
	glfwGetWindowSize(mWindow, &wWidth, &wHeight);
	float new_density = (float)fWidth / (float)wWidth;
	if(new_density != density) {
		recreate_context = true;
		density = new_density;
	map->resize(fWidth, fHeight);

What can i do, to rendering Tangram correctly in Background ?

Thank you and best regards,
Roman H.


Offer 50$ for working solution


What does the header for MapScene look like?


I tried it at start simple:


#include <GLFW/glfw3.h>
#include "tangram.h"
#include "linuxPlatform.h"

class MapScene {
    std::shared_ptr<Tangram::Platform> platform;
    Tangram::Map* map = nullptr;
    GLFWwindow* mWindow  = nullptr;
    float density = 1.0;
    bool recreate_context = false;
    double lastTime;
    double currentTime;
    double delta;
    void create();
    void update(float);
    void framebufferResizeCallback(GLFWwindow*, int, int);

#endif // __MAPSCENE_LINUX_HPP__


Can you post a picture of what is happening, please.


Sure, i posting a video today or tomorrow as soon as i’m home.
Cocos2d should run in foreground and tangram-es in background.


Here is the Video:

But: Theres flicker very fast, so fast, that i can’t record it (on Mouseover)