aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/JSL.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-02 10:08:58 +0800
committerchai <chaifix@163.com>2018-09-02 10:08:58 +0800
commit3bb587f0d7c471a70683fa7d26939d21968dea98 (patch)
tree6ef9e75b5159dda0a8d1dc4ef8640be4eacc6343 /src/libjin/Graphics/JSL.cpp
parent862763a88f6b4a6cb6c034287c509a91776adf8b (diff)
*update
Diffstat (limited to 'src/libjin/Graphics/JSL.cpp')
-rw-r--r--src/libjin/Graphics/JSL.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libjin/Graphics/JSL.cpp b/src/libjin/Graphics/JSL.cpp
index fb6279a..e22e872 100644
--- a/src/libjin/Graphics/JSL.cpp
+++ b/src/libjin/Graphics/JSL.cpp
@@ -54,7 +54,6 @@ void main()
GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragmentShader, 1, (const GLchar**)&fs, NULL);
glCompileShader(fragmentShader);
-
pid = glCreateProgram();
glAttachShader(pid, fragmentShader);
glLinkProgram(pid);
@@ -84,7 +83,6 @@ void main()
void JSLProgram::sendFloat(const char* variable, float number)
{
checkJSL();
-
int loc = glGetUniformLocation(pid, variable);
glUniform1f(loc, number);
}
@@ -92,7 +90,6 @@ void main()
void JSLProgram::sendTexture(const char* variable, const Texture* tex)
{
checkJSL();
-
GLint location = glGetUniformLocation(pid, variable);
if (location == -1)
return;
@@ -106,7 +103,6 @@ void main()
void JSLProgram::sendCanvas(const char* variable, const Canvas* canvas)
{
checkJSL();
-
GLint location = glGetUniformLocation(pid, variable);
if (location == -1)
return;
@@ -120,7 +116,6 @@ void main()
void JSLProgram::sendVec2(const char* name, float x, float y)
{
checkJSL();
-
int loc = glGetUniformLocation(pid, name);
glUniform2f(loc, x, y);
}
@@ -128,7 +123,6 @@ void main()
void JSLProgram::sendVec3(const char* name, float x, float y, float z)
{
checkJSL();
-
int loc = glGetUniformLocation(pid, name);
glUniform3f(loc, x, y, z);
}
@@ -136,7 +130,6 @@ void main()
void JSLProgram::sendVec4(const char* name, float x, float y, float z, float w)
{
checkJSL();
-
int loc = glGetUniformLocation(pid, name);
glUniform4f(loc, x, y, z, w);
}
@@ -144,7 +137,6 @@ void main()
void JSLProgram::sendColor(const char* name, const color* col)
{
checkJSL();
-
int loc = glGetUniformLocation(pid, name);
glUniform4f(loc,
col->rgba.r / 255.f,
@@ -154,7 +146,7 @@ void main()
);
}
-}
-}
+} // graphics
+} // jin
#endif // JIN_MODULES_RENDER \ No newline at end of file