我正在尝试为Ember.js应用程序编写一个基于custom.js的自定义服务器.我相处得很好,但是我一直在试图猜测Ember Data在特定时刻所期待的JSON响应.
这个全新的文档是一个很好的开始http://emberjs.com/guides/models/the-rest-adapter/但不够完整.
我在黑暗中的刺伤让我明白了(Ember pre4,Ember Data 11):
Context Server URL Method Req. Data Resp. Data
~~~~~~~ ~~~~~~~~~~ ~~~~~~ ~~~~~~~~~ ~~~~~~~~~~
Getting a list of all users /users GET {"users":[{...},{...}]}
Getting a particular user /users/123 GET {"user":{...}}
Creating a user /users POST {"user":{...}} ???
Updating a user /users/123 PUT {"user":{...}} ???
Deleting a user /users/123 DELETE ??? ???
Creating a user (bulkUpdate) /users POST {"users":[{...},{...}]} ???
Updating a user (bulkUpdate) /users/bulk PUT {"users":[{...},{...}]} ???
Deleting a user (bulkUpdate) /users/123 …Run Code Online (Sandbox Code Playgroud) 看起来这应该很简单,但是使用点精灵的部分纹理我遇到了很多困难.我已经广泛搜索并提出了各种答案,但这些都没有解决我遇到的具体问题.
到目前为止我学到了什么:
这是我想要实现的图表

我在哪里:
码:
顶点着色器
uniform mat4 Projection;
uniform mat4 Modelview;
uniform float PointSize;
attribute vec4 Position;
attribute vec2 TextureCoordIn;
varying vec2 TextureCoord;
void main(void)
{
gl_Position = Projection * Modelview * Position;
TextureCoord = TextureCoordIn;
gl_PointSize = PointSize;
}
Run Code Online (Sandbox Code Playgroud)
片段着色器
varying mediump vec2 TextureCoord;
uniform sampler2D Sampler;
void main(void)
{
// Using my TextureCoord just draws a grey square, so
// I'm likely …Run Code Online (Sandbox Code Playgroud)