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

Examples #644

Closed
agmcleod opened this issue Feb 8, 2015 · 16 comments
Closed

Examples #644

agmcleod opened this issue Feb 8, 2015 · 16 comments
Milestone

Comments

@agmcleod
Copy link
Collaborator

agmcleod commented Feb 8, 2015

Just an idea. Wondering if maybe we should publish a gh-pages branch of this, that keeps the stable version of code. 2.0.2 for example. And have it link all the examples. Update the jasmine test page to be specs.html instead of index.html.

We don't need to maintain an examples repo that way, and we can improve accessibility of the engine.

@parasyte
Copy link
Collaborator

parasyte commented Feb 8, 2015

👍

@obiot
Copy link
Member

obiot commented Feb 9, 2015

yes and no, as adding gh-pages branch, is, as implied, a different branch so it's not only a symbolic link to the examples, so we still need to copy them all from master to gh-pages when updated.

@parasyte
Copy link
Collaborator

parasyte commented Feb 9, 2015

It will have to be done as part of the release task, anyway. Because we currently don't commit the melonjs build files...

@agmcleod
Copy link
Collaborator Author

agmcleod commented Feb 9, 2015

@obiot for the examples, we simply merge master into the gh-pages on update. Jason is right though, we will need something to handle the build files.

@agmcleod
Copy link
Collaborator Author

Question. I know the examples repo has: http://melonjs.github.io/examples/, but no index. And then this repo has its index to list examples. Should we try to consolidate?

@parasyte
Copy link
Collaborator

@agmcleod I like the original proposal the best. Now that we have a release task, it can be updated to merge the tag into gh-pages before it pushes. Seems like that should be simple enough.

@obiot obiot added this to the 3.0.0 milestone Jul 29, 2015
@parasyte
Copy link
Collaborator

Oh! Oh! https://github.com/pajtai/grunt-build-gh-pages Just what we need. Seems like we should also put the generated docs into gh-pages, too. ;)

@parasyte
Copy link
Collaborator

Success! http://melonjs.github.io/melonJS/examples/platformer2/#webgl

The one thing left to do IMHO is add a link for the docs to index.html. Then we can deprecate the examples and docs repos! Have them forward to the new gh-pages branch.

parasyte added a commit that referenced this issue Sep 25, 2015
@obiot
Copy link
Member

obiot commented Sep 27, 2015

so wait, we do not need that repository anymore then :
https://github.com/melonjs/examples

correct ? as the examples are automatically put online on the melons/melonjs gh-page branch, when using grunt dist ?

not sure I got where is the docs though, but if build out of master, we need anyway to keep melons/docs for the stable version.

@obiot
Copy link
Member

obiot commented Sep 27, 2015

Oh, I just noticed that the platformer is not working on my iphone under ios9 :(

Did u get it to work using the simulator? Maybe a texture related issue with webgl?

@parasyte
Copy link
Collaborator

WebGL is broken on iOS. I updated the TODO list in #637 to get that fixed...

The other thing is we won't always run grunt gh-pages, it's a sub-task of grunt release. I expected it to be updated with releases only. We have the ability to run grunt gh-pages separately though, and from any branch (though I only tested it on master). That would be nice for dot-releases and minor updates, anyway.

@obiot
Copy link
Member

obiot commented Sep 27, 2015

hmm... shader ? the exception I had on my side was the following, with max_size being equal to 8 :
https://github.com/melonjs/melonJS/blob/master/src/video/texture_cache.js#L37

@parasyte
Copy link
Collaborator

According to http://webglstats.com/ only 10% of devices support 8 texture units (MAX_TEXTURE_IMAGE_UNITS) ... While 90% support 16. Which iPhone do you have?

We can always cut down the number of textures that get loaded. There is one 1x1 px white texture that is required (for color fills) and another is required for font drawing. Platformer2 has two image layers which cannot be packed, because they use the repeat modes. And of course the texture atlas. We should be able to get by with just 5 textures!

I'll do some debugging to learn why it adds more than 8...

@parasyte
Copy link
Collaborator

Got it... There's a bug. 😃

Here's a list of all textures that get uploaded on Platformer2:

  1. fillTexture
  2. fillTexture
  3. fontTexture
  4. fontTexture
  5. "http://localhost:8000/examples/platformer2/data/img/tileset.png"
  6. "http://localhost:8000/examples/platformer2/data/img/background.png"
  7. "http://localhost:8000/examples/platformer2/data/img/background.png"
  8. "http://localhost:8000/examples/platformer2/data/img/clouds.png"
  9. "http://localhost:8000/examples/platformer2/data/img/clouds.png"
  10. "http://localhost:8000/examples/platformer2/data/img/texture.png"
  11. "http://localhost:8000/examples/platformer2/data/img/atascii_24px.png"

What's this? Duplicates?! (Highlighted in bold) This is an easy fix, and will reduce the number to 7. But still, we have three textures that could be packed into one ... the tileset, the characters (texture.png), and the bitmap font (atascii_24px.png)

parasyte added a commit that referenced this issue Sep 27, 2015
- This was not increasing memory usage, just synthetically increasing the cache length (oops)
- See: #644 (comment)
@obiot
Copy link
Member

obiot commented Sep 28, 2015

awesome, that's what I also noticed yesterday night. I was not satisfied with what I saw versus your feedback and saw the same duplicates when I listed all the textures used in the examples :) but it was too late though and went to sleep :P

@obiot
Copy link
Member

obiot commented Sep 28, 2015

oh and it's a iphone6, which is why it really raised my suspicions in terms of texture limitation :)

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

No branches or pull requests

3 participants