Commit 85fd18da authored by thery's avatar thery

update systeme de compilation des shaders pour windows

parent 477b3868
......@@ -20,6 +20,7 @@ IF(WIN32)
add_subdirectory(gzstream/Build)
add_subdirectory(Numerical)
add_subdirectory(Assimp/code)
add_subdirectory(Tools)
# if(CMAKE_CONFIGURATION_TYPES)
# set(CMAKE_CONFIGURATION_TYPES Release)
# set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
......
......@@ -4,6 +4,8 @@ project(Tools)
SET (CMAKE_BUILD_TYPE Release)
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/ThirdParty/Tools)
add_executable( shader_to_h shader_to_h.cpp )
target_link_libraries( shader_to_h )
......@@ -5,7 +5,7 @@
int main(int argc, char **argv)
{
char buffer[512];
for (unsigned int i=1; i< argc; ++i)
for (int i=1; i< argc; ++i)
{
std::string filename(argv[i]);
......@@ -54,11 +54,20 @@ int main(int argc, char **argv)
sso << "std::string "<<sub<< " =";
// text of shader
unsigned int nbbl=0;
while (!fs.eof())
{
fs.getline(buffer,512);
if (!fs.eof() && (*buffer!=0))
//std::cout << buffer << std::endl;
if (*buffer!=0)
{
for (unsigned int i=0; i<nbbl;++i)
sso << std::endl <<"\"\\n\"";
nbbl=0;
sso << std::endl << "\"" << buffer <<"\\n\"";
}
else
nbbl++;
};
sso << ";"<< std::endl<< std::endl;
......
......@@ -79,10 +79,21 @@ file(
${CGoGN_ROOT_DIR}/include/Utils/Shaders*.geom
)
IF(WIN32)
add_custom_target(shader_targetD ${CGoGN_ROOT_DIR}/ThirdParty/Tools/Release/shader_to_h ${shaders_srcD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_srcD}
)
ELSE(WIN32)
add_custom_target(shader_targetD ${CGoGN_ROOT_DIR}/ThirdParty/Tools/shader_to_h ${shaders_srcD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_srcD}
)
ENDIF(WIN32)
file(
......
......@@ -93,10 +93,19 @@ file(
${CGoGN_ROOT_DIR}/include/Utils/Shaders*.geom
)
IF(WIN32)
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/Tools/Release/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src}
)
ELSE(WIN32)
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/Tools/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src}
)
ENDIF(WIN32)
......
......@@ -7,4 +7,4 @@ FRAG_OUT_DEF;
void main (void)
{
float lum = texture2D(FontTexture, tex_coord).s;;
}
// no "}" because it is added in the shader class code (with other things)
......@@ -2,7 +2,7 @@
ATTRIBUTE vec4 VertexPosition;
uniform mat4 ModelViewMatrix;
uniform mat4 ProjectionMatrix
uniform mat4 ProjectionMatrix;
uniform vec3 strPos;
uniform float scale;
VARYING_VERT vec2 tex_coord;
......@@ -13,3 +13,4 @@ void main ()
tex_coord = vec2(VertexPosition[2],VertexPosition[3]);
gl_Position = ProjectionMatrix * pos;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment