Code Monkey home page Code Monkey logo

Comments (16)

lukelutman avatar lukelutman commented on July 30, 2024

Micah,

That's great!

I think having a separate branch for GLES 2.0 would be fine (that's how the Cocos2D repo is setup, they don't support both ES 1.0 and ES 2.0). I'm not likely going to have much time to work on this right away, so if you want to fork CCSVG, I think that's a good plan :-)

A bit off topic, but... We're using Cocos2D 2.0 for everything these days. When we ran into the ES 2.0 compatibility issue, I kind of did an end-run around the problem. If you look at my fork of MonkVG, I added a code path for dumping all the vertices in a batch just before they get submitted to OpenGL (1). We're using the OS X version of MonkSVG and MonkVG to dump the vertices to a binary file in an offline preprocess step, then loading the binary file and dumping the data directly into OpenGL. This is super fast (since there's no tesselation at run time), it gives us a better idea of memory footprint (size of file on disk == size of file in memory), and it's compatible with ES 1.0 and ES 2.0 to boot.

Luke

  1. lukelutman/MonkVG@6d5d1e0

from ccsvg.

micahpearlman avatar micahpearlman commented on July 30, 2024

So I forked CCSVG and got it all working with Cocos2d 2.0. I spent a bunch of wasted time chasing down some crazy phantom issues with Xcode so I probably changed more things then was necessary. I rebuilt the Xcode workspace and sub-projects, and now CCSVG is not even a project but just a source code copy. Also, the git submodules now point to my versions of MonkVG and MonkSVG. Sorry if that messes you up too much. Would you still be interested in a "pull request" on my fork?

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

Micah - Can you share your modifications? I'm struggling with getting CCSVG to work with Cocos2d 2.0

from ccsvg.

micahpearlman avatar micahpearlman commented on July 30, 2024

Clone my fork of CCSVG to get it to work on Cocos2D 2.x

On May 31, 2013, at 5:46 PM, W1ngy [email protected] wrote:

Micah - Can you share your modifications? I'm struggling with getting CCSVG to work with Cocos2d 2.0


Reply to this email directly or view it on GitHub.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

Awesome! Thanks Micah.
I was able to run the example project successfully but when I add a CCSVG to a layer in my project the entire screen goes white :(

from ccsvg.

micahpearlman avatar micahpearlman commented on July 30, 2024

Hmmm. Perhaps the MonkVG shaders aren't being loaded? I'm not in front of the code so I can't tell you off the top of my head where to check but it should be somewhat obvious.

~~
Micah Pearlman
[email protected]
415-637-6986
http://www.linkedin.com/pub/micah-pearlman/16/7b6/193
~~

On Jun 1, 2013, at 9:20 AM, W1ngy [email protected] wrote:

Awesome! Thanks Micah.
I was able to run the example project successfully but when I add a CCSVG to a layer in my project the entire screen goes white :(


Reply to this email directly or view it on GitHub.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

After further investigation I noticed that its my regular CCSprites that are turning white.

from ccsvg.

micahpearlman avatar micahpearlman commented on July 30, 2024

Can you render an SVG image with CCSVG?

On Jun 1, 2013, at 9:35 AM, W1ngy [email protected] wrote:

After further investigation I noticed that its my regular CCSprites that are turning white.


Reply to this email directly or view it on GitHub.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

Yeah. The svg renders but the other sprites turn white. When I remove the CCSVGSprite then they turn back to their normal colors.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

Its only happening to the CCSprites that have a Z order higher than the CCSVGSprite.

from ccsvg.

micahpearlman avatar micahpearlman commented on July 30, 2024

Can you set up an example project with the bug? I'm guessing the GL state isn't being properly restored after an SVG image is being rendered. Do you have any GL state optimizations in the Cocos side turned on or something?

On Jun 1, 2013, at 10:22 AM, W1ngy [email protected] wrote:

Its only happening to the CCSprites that have a Z order higher than the CCSVGSprite.


Reply to this email directly or view it on GitHub.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

Yeah you're right. Its using one of the colors from the svg and painting everything else with that color.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

I tried making a demo app but can't reproduce the problem. I haven't made any changes to any of the cocos2d files in my project.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

I replaced all the libraries in my project with fresh copies and now everything works :D

from ccsvg.

micahpearlman avatar micahpearlman commented on July 30, 2024

Yay!

On Jun 1, 2013, at 6:40 PM, W1ngy [email protected] wrote:

I replaced all the libraries in my project with fresh copies and now everything works :D


Reply to this email directly or view it on GitHub.

from ccsvg.

david-a-campbell avatar david-a-campbell commented on July 30, 2024

The regex in mkSVG for finding the bounds info ignores anything with decimals. So it finds 512 but not 512.12 or 512.00

I fixed using - regex numberWithUnitPattern( "^(-?\d+(\.\d+)?)(px)?$" );

from ccsvg.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.