/** * Initialises the console. * * @author Rian Drake. */ void CRuntimeShaderConsole::Initialise() { m_Text.Create("data/plugins/RuntimeShaders/Fonts/couriernew"); m_hWnd = GetFocus(); m_parentCallback = GetWindowLongPtr(m_hWnd, GWLP_WNDPROC); SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG)GetMsgProc); float v[] = { -1.0f, -0.95f, -1.0f, -1.0f, +1.0f, -0.95f, +1.0f, -1.0f, }; TAttribute a[] = { TAttribute("position", 0, GL_FLOAT, 2, 0, false, 0) }; m_ShaderProgram.AttachShader(TShader(GL_VERTEX_SHADER, "data/plugins/runtimeshaders/shaders/console_vs.glsl")); m_ShaderProgram.AttachShader(TShader(GL_FRAGMENT_SHADER, "data/plugins/runtimeshaders/shaders/console_fs.glsl")); glGenBuffers(1, &m_VertexBuffer); m_ShaderProgram.AttachAttributes(TAttributeBatch(a, 1, 0, 8, m_VertexBuffer)); glBufferData(GL_ARRAY_BUFFER, sizeof(v), v, GL_STATIC_DRAW); InitialiseCommandMap(); RuntimeShaders->DetachShaderProgram(&m_ShaderProgram); }
// Constructor TSimpleFX::TSimpleFX(const std::string& _vertex, const std::string& _fragment) : TVFX(TShader(_vertex, _fragment)) { }