Gles20 porting #115

Merged
merged 7 commits into from Oct 18, 2011

Conversation

Projects
None yet
2 participants
Contributor

chapados commented Oct 18, 2011

Hi Riq,

We're in the process of porting an app to the gles20 branch. In the process, I added a few pieces of missing functionality (i.e. alpha test support), and other methods that made the process easier.

Brian Chapados added some commits Oct 12, 2011

Make -[CCSprite initWithTexture:rect:rotated:] the designated initial…
…izer

The current -[CCSprite initWithTexture:rect:] explicitly passes a 'NO' value
for rotation to -[CCSprite setTextureRect:rotated:untrimmedSize:].

This change adds the rotated BOOL param as part the initializer,
allowing the initialization of sprites with a rotated rect.
Add fragment shader for alpha testing.
OpenGLES 2.0 does not support glAlphaTest or glAlphaFunc.
This change set adds a simple fragment shader to the default set of cocos2d shaders
that performs the equivalent of a glAlphaTest with by comparing the incoming alpha value
with a specified uniform float, using the equivalent of a (greater-than-or-equal-to)
'>=' comparison.  This produces the same results as:

glAlphaFunc(GL_GREATER, <value>)
glEnable(GL_ALPHA_TEST)

However, due to the use of shaders, the configuration is slightly different, since
for cocos2d, use of the alpha test shader must specified on a per-drawing-node basis.
Add support for specifying a CCTexture2D object to associate with spr…
…ite frames.

This allows a dictionary or plist of sprite frames to be associated with the specified texture
or a texture file.  This was possible in cocos2d 1.x, but is not present in the current 2.x
branch.
Declare dispatch queues for loading and dict updates as ivars of CCTe…
…xtureCache.

CCTextureCache is already a singleton, so these queues will only be created once.
Declaring them as ivars allows them to be accessed in categories of CCTextureCache
that extend/modify loading behavior.
Add -[CCSprite initWithBatchNode:rect:rotated]
This change adds the optional 'rotated' param to specify a rotated
rect when creating a sprite with a batch node.

ghost pushed a commit that referenced this pull request Oct 18, 2011

Merge pull request #115 from booyah/gles20-porting
Makes porting to cocos2d-v2.x gles20 easier

@ghost ghost merged commit a880051 into cocos2d:gles20 Oct 18, 2011

lhunath pushed a commit to lhunath/cocos2d-iphone that referenced this pull request Nov 11, 2013

Merge pull request #115 from booyah/gles20-porting
Makes porting to cocos2d-v2.x gles20 easier

dalinaum pushed a commit to dalinaum/cocos2d-iphone that referenced this pull request Apr 6, 2014

Merge pull request #115 from booyah/gles20-porting
Makes porting to cocos2d-v2.x gles20 easier

Former-commit-id: a880051
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment