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

How to create the buffer used in GL10.glVertexPointer(int size, int type, int stride, Buffer pointer) ? #53

Open
agGitHub opened this issue Dec 14, 2011 · 2 comments

Comments

@agGitHub
Copy link

I have got the following code in my Cocos2D-iOS program:

CGPoint corners[10];

for(int i = 0; i < 10; i++)
{
corners[i] = CGPointMake(0, 0);
}

glVertexPointer(2, GL_FLOAT, 0, corners);

that I would like to "translate" like this in Cocos2D-Android:

CGPoint[] corners = new CGPoint[4];

for(int i = 0; i < 10; i++)
{
corners[i] = CGPoint.make(0, 0);
}

(CCDirector.gl).glVertexPointer(2, GL10.GL_FLOAT, 0, corners);

but corners should be a "Buffer" according to GL10.glVertexPointer definition.

How to create such a buffer with my CGPoints ?

Thanks !

PS: I am new on Cocos2D-Android, sorry for my potentially trivial questions...

@gwennguihal
Copy link
Contributor

See CCDrawPrimitives.java

@agGitHub
Copy link
Author

Thanks for your answer but I don't see any CCDrawPrimitives in the ZhouWeikuan source files (I dont' use the jar but the source files). Where can I find this class ? Thanks.

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