MCPcopy Create free account
hub / github.com/OGRECave/ogre / _setTextureBlendMode

Method _setTextureBlendMode

RenderSystems/GL/src/OgreGLRenderSystem.cpp:1907–2119  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1905 }
1906 //-----------------------------------------------------------------------------
1907 void GLRenderSystem::_setTextureBlendMode(size_t stage, const LayerBlendModeEx& bm)
1908 {
1909 if (stage >= mFixedFunctionTextureUnits)
1910 {
1911 // Can't do this
1912 return;
1913 }
1914
1915 GLenum src1op, src2op, cmd;
1916 GLfloat cv1[4], cv2[4];
1917
1918 if (bm.blendType == LBT_COLOUR)
1919 {
1920 cv1[0] = bm.colourArg1.r;
1921 cv1[1] = bm.colourArg1.g;
1922 cv1[2] = bm.colourArg1.b;
1923 cv1[3] = bm.colourArg1.a;
1924 mManualBlendColours[stage][0] = bm.colourArg1;
1925
1926
1927 cv2[0] = bm.colourArg2.r;
1928 cv2[1] = bm.colourArg2.g;
1929 cv2[2] = bm.colourArg2.b;
1930 cv2[3] = bm.colourArg2.a;
1931 mManualBlendColours[stage][1] = bm.colourArg2;
1932 }
1933
1934 if (bm.blendType == LBT_ALPHA)
1935 {
1936 cv1[0] = mManualBlendColours[stage][0].r;
1937 cv1[1] = mManualBlendColours[stage][0].g;
1938 cv1[2] = mManualBlendColours[stage][0].b;
1939 cv1[3] = bm.alphaArg1;
1940
1941 cv2[0] = mManualBlendColours[stage][1].r;
1942 cv2[1] = mManualBlendColours[stage][1].g;
1943 cv2[2] = mManualBlendColours[stage][1].b;
1944 cv2[3] = bm.alphaArg2;
1945 }
1946
1947 switch (bm.source1)
1948 {
1949 case LBS_CURRENT:
1950 src1op = GL_PREVIOUS;
1951 break;
1952 case LBS_TEXTURE:
1953 src1op = GL_TEXTURE;
1954 break;
1955 case LBS_MANUAL:
1956 src1op = GL_CONSTANT;
1957 break;
1958 case LBS_DIFFUSE:
1959 src1op = GL_PRIMARY_COLOR;
1960 break;
1961 // XXX
1962 case LBS_SPECULAR:
1963 src1op = GL_PRIMARY_COLOR;
1964 break;

Callers

nothing calls this directly

Calls 1

activateGLTextureUnitMethod · 0.45

Tested by

no test coverage detected