This file contains hidden or 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
| in examples like hdr.cpp: | |
| #ifndef SKIP_ENTRY_IMPLEMENT_MAIN | |
| ENTRY_IMPLEMENT_MAIN(ExampleHDR); | |
| #endif | |
| ---------------------------------------------------------------------- | |
| in mega.cpp: | |
| /* |
This file contains hidden or 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
| From metal documentation: | |
| "Command buffer and command encoder objects are transient and designed for a single use. | |
| They are very inexpensive to allocate and deallocate, so their creation methods return autoreleased objects." | |
| https://developer.apple.com/library/content/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Cmd-Submiss/Cmd-Submiss.html | |
| Autorelease example: | |
| NSAutoreleasePool* autoreleasePool = [[NSAutoreleasePool alloc] init]; | |
| //c is an autoreleased object |
This file contains hidden or 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-2016 Attila Kocsis. All rights reserved. | |
| * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause | |
| */ | |
| #include "bgfx_p.h" | |
| #if BGFX_CONFIG_RENDERER_METAL | |
| #include "renderer_mtl.h" |
This file contains hidden or 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
| Index: renderer_gl.cpp | |
| =================================================================== | |
| --- renderer_gl.cpp (revision 972) | |
| +++ renderer_gl.cpp (revision 973) | |
| @@ -2756,6 +2756,16 @@ | |
| , name | |
| , glGetAttribLocation(m_id, name) | |
| ); | |
| + | |
| + bool found = false; |
This file contains hidden or 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 Attila Kocsis, Branimir Karadzic. All rights reserved. | |
| * License: http://www.opensource.org/licenses/BSD-2-Clause | |
| */ | |
| #include "bgfx_p.h" | |
| #if BGFX_CONFIG_RENDERER_METAL | |
| #import <QuartzCore/CAMetalLayer.h> | |
| #import <UIKit/UiView.h> |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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(); |