Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the version of horde2d and cocos2d-x that your fork based on. #6

Open
yihuang opened this issue Nov 7, 2013 · 4 comments
Open

Comments

@yihuang
Copy link

yihuang commented Nov 7, 2013

I want to migrate it to cocos2d-x 2.x .

@attilaz
Copy link
Owner

attilaz commented Nov 8, 2013

cocos2d-x 2.1
horde3d is branched from svn sourceforge half year ago.

@yihuang
Copy link
Author

yihuang commented Dec 12, 2013

I'm not familiar with 3d programming, but i want to display some 3d objects in my cocos2d-x game, i try to display a cocos2d-x CCSprite and horde3d KnightX Scene, but the cocos2d-x part doesn't display at all. Commenting out the ClearTarget part in pipeline xml don't help too.
What steps should i take to make it work together, or is it possible at all?
Thanks very much.

@yihuang
Copy link
Author

yihuang commented Dec 13, 2013

It's so nice if i can use horde3d to add some 3d objects to my existing cocos2d-x game, and this feature can definitely improve horde3d's acceptance. I can put some time into this, but I need to be enlightened.

@attilaz
Copy link
Owner

attilaz commented Dec 13, 2013

I think it is caused because h3d modifies some state, you should reset states before rendering with cocos2d-x.
here is what I'm doing for state reset:

glViewport(0,0,width, height);

glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
glDisable(GL_BLEND);

glLineWidth(1.0);

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glActiveTexture(GL_TEXTURE0);

for( unsigned int i = 0; i < ATTRIB_COUNT; ++i )
    glDisableVertexAttribArray( i );

hope it helps.
Also I don't want to discourage you using h3d, but cocos2d-x will also have an official 3d extension. If you are planning in the long term, maybe it is a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants