Monday, May 16, 2016

C.preprocessor.cocos2d.shader



[]
What does #include actually do?



[ www.en.wikipedia.org ]

[phases]
...
Logically, that copy/paste is exactly what happens. I'm afraid there isn't any more to it. You don't need the ;, though.
Your specific example is covered by the spec, section 6.10.2 Source file inclusion, paragraph 3:
A preprocessing directive of the form
# include "q-char-sequence" new-line
causes the replacement of that directive by the entire contents of the source file identified by the specified sequence between the " delimiters.
...
_____________________________________________________________________
___
___
___
//ccShaders.h
#ifndef __CCSHADER_H__
#define __CCSHADER_H__
#include ""
#include ""
NS_CC_BEGIN

extern CC_DLL const GLchar * ccPosition_uColor_frag;
extern CC_DLL const GLchar * ccPosition_uColor_vert;

extern CC_DLL const GLchar * ccPositionColor_frag;
extern CC_DLL const GLchar * ccPositionColor_vert;
......

NS_CC_END
#endif//

___
___
___
//ccShaders.cpp
#include "ccShaders.h"
#define STRINGIFY(A)   #A
NS_CC_BEGIN
#include "ccShader_Position_uColor.frag"
#include "ccShader_Position_uColor.vert"
......
NS_CC_END
#endif//
___
___
________________________________________________________________________
[ Include files ]

[ Conditional compilation ]

[ Macro definition and expression ]

[ Special macros and directives ]

[ Token stringification ]


[ Token concatenation ]

[ User-defined compilation errors ]

[ Implementatisons ]
[ Compiler-specific preprocessor features ]

[ Others ]

No comments:

Post a Comment