Skip to content

CCShader API #1216

Open
Open
@Birkemose

Description

@Birkemose

I was doing some work on descendants of CCShader, and ran into a few issues.

The basic API is fine, easy to use, and will make a lot of people happy. However, a lot of the implementation is hidden, and not available if you want to create a descendant.
It is much like the old CCTexture, where you didn't have a method for converting pixel format, which made it impossible to override CCTexture for your own custom load stuff.

As an example, I needed to load a new fragment shader, using my own load and compile code. This was pretty much impossible, without copying and pasting code from CCShader. I see no reason why ex. load and compile, shouldn't me methods in CCShader, which I can use. All the code is there.

On a more general note, I guess the discussion is, that to maintain Cocos2D's reputation of being easy to customise, it is important to expose every piece of code which goes into the API, at least in a private header, and to keep the number of lines of code in init as low as possible, and in stead call some of the class own methods.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions