This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2011-2015 Branimir Karadzic. All rights reserved. | |
* License: http://www.opensource.org/licenses/BSD-2-Clause | |
*/ | |
#include "common.h" | |
#include "bgfx_utils.h" | |
struct PosColorVertex | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2011-2015 Branimir Karadzic. All rights reserved. | |
* License: http://www.opensource.org/licenses/BSD-2-Clause | |
*/ | |
#include "common.h" | |
#include "bgfx_utils.h" | |
struct PosColorVertex | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2011-2015 Branimir Karadzic. All rights reserved. | |
* License: http://www.opensource.org/licenses/BSD-2-Clause | |
*/ | |
#include "common.h" | |
#include "bgfx_utils.h" | |
struct PosColorVertex | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ProgramGL::bindAttributes(const VertexDecl& _vertexDecl, uint32_t _baseVertex) const | |
{ | |
for (uint32_t ii = 0; ii < 15; ++ii) | |
GL_CHECK(glDisableVertexAttribArray(ii) ); | |
for (uint32_t ii = 0; Attrib::Count != m_used[ii]; ++ii) | |
{ | |
Attrib::Enum attr = Attrib::Enum(m_used[ii]); | |
GLint loc = m_attributes[attr]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (ImGui::CollapsingHeader("Horizontal Layout")) | |
{ | |
// Text | |
ImGui::Text("Hello"); | |
ImGui::SameLine(); | |
ImGui::Text("World"); | |
// Button | |
if (ImGui::Button("Banana")) printf("Pressed!\n"); | |
ImGui::SameLine(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (ImGui::CollapsingHeader("Horizontal Layout")) | |
{ | |
// Text | |
ImGui::Text("Hello"); | |
ImGui::SameLine(); | |
ImGui::Text("World"); | |
// Button | |
if (ImGui::Button("Banana")) printf("Pressed!\n"); | |
ImGui::SameLine(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,0,1,GL_ARB_vertex_array_object,glBindVertexArray,1,3.764, | |
,3,1,GL_ARB_framebuffer_object,glBindFramebuffer,GL_FRAMEBUFFER 0,17.452, | |
,6,1,GL_ARB_vertex_buffer_object,glBindBuffer,GL_ARRAY_BUFFER 6,4.106, | |
,9,1,GL_ARB_vertex_buffer_object,glBufferSubData,GL_ARRAY_BUFFER 0 2000 0x23157FB8,13.345, | |
,12,1,GL_ARB_vertex_buffer_object,glBindBuffer,GL_ARRAY_BUFFER 0,1.711, | |
,15,1,GL_ARB_framebuffer_object,glBindFramebuffer,GL_FRAMEBUFFER 0,1.711, | |
,18,1,GL_ARB_framebuffer_object,glBindFramebuffer,GL_FRAMEBUFFER 2,4.791, | |
,22,1,OpenGL_1.0,glViewport,0 0 1024 1024,40.721, | |
,25,1,OpenGL_1.0,glClearDepth,1.000000,8.897, | |
,28,1,OpenGL_1.0,glDepthMask,GL_TRUE,1.711, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace bgfx | |
{ | |
# define GL_IMPORT(_optional, _proto, _func, _import) _proto _func = NULL | |
# include "glimports.h" | |
void GlContext::create(uint32_t _width, uint32_t _height) | |
{ | |
glGetIntegerv( GL_FRAMEBUFFER_BINDING, (GLint*)&m_fbo ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
C++ interface | |
*/ | |
namespace mtl | |
{ | |
class CommandQueue | |
{ | |
public: | |
CommandQueue(id <MTLCommandQueue> commandQueue = nil) : m_commandQueue(commandQueue) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Interface Orientation | |
UIInterfaceOrientation mnOrientation; | |
// Renderer globals | |
mtl::Device m_Device; | |
mtl::CommandQueue m_CommandQueue; | |
mtl::Library m_ShaderLibrary; | |
mtl::DepthStencilState m_DepthState; | |
// textured Quad |
OlderNewer