GLRenderer.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. /*
  2. Copyright (c) 2013 Daniele Bartolini, Michele Rossi
  3. Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
  4. Permission is hereby granted, free of charge, to any person
  5. obtaining a copy of this software and associated documentation
  6. files (the "Software"), to deal in the Software without
  7. restriction, including without limitation the rights to use,
  8. copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the
  10. Software is furnished to do so, subject to the following
  11. conditions:
  12. The above copyright notice and this permission notice shall be
  13. included in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  16. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  19. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  21. OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #include "Config.h"
  24. #if defined(LINUX) || defined(WINDOWS)
  25. #include <GL/glew.h>
  26. #elif defined(ANDROID)
  27. #include <GLES2/gl2.h>
  28. #else
  29. #error "Oops, wrong platform"
  30. #endif
  31. #include <algorithm>
  32. #include "Allocator.h"
  33. #include "Assert.h"
  34. #include "Types.h"
  35. #include "GLRenderer.h"
  36. #include "Log.h"
  37. #include "Vec4.h"
  38. #include "Mat3.h"
  39. #include "Mat4.h"
  40. #include "Device.h"
  41. #include "Hash.h"
  42. #include "StringUtils.h"
  43. namespace crown
  44. {
  45. //-----------------------------------------------------------------------------
  46. const GLenum PRIMITIVE_TYPE_TABLE[] =
  47. {
  48. GL_TRIANGLES,
  49. GL_POINTS,
  50. GL_LINES
  51. };
  52. //-----------------------------------------------------------------------------
  53. const GLenum TEXTURE_MIN_FILTER_TABLE[] =
  54. {
  55. 0, // Unused
  56. GL_NEAREST,
  57. GL_LINEAR,
  58. GL_NEAREST_MIPMAP_LINEAR,
  59. GL_LINEAR_MIPMAP_LINEAR
  60. };
  61. //-----------------------------------------------------------------------------
  62. const GLenum TEXTURE_MAG_FILTER_TABLE[] =
  63. {
  64. 0, // Unused
  65. GL_NEAREST,
  66. GL_LINEAR,
  67. GL_LINEAR,
  68. GL_LINEAR
  69. };
  70. //-----------------------------------------------------------------------------
  71. const GLenum TEXTURE_WRAP_TABLE[] =
  72. {
  73. 0, // Unused
  74. GL_CLAMP_TO_EDGE,
  75. GL_REPEAT
  76. };
  77. //-----------------------------------------------------------------------------
  78. const GLTextureFormatInfo TEXTURE_FORMAT_TABLE[PIXEL_COUNT] =
  79. {
  80. { GL_RGB, GL_RGB },
  81. { GL_RGBA, GL_RGBA}
  82. };
  83. // Keep in sync with ShaderAttrib
  84. const char* const SHADER_ATTRIB_NAMES[ATTRIB_COUNT] =
  85. {
  86. "a_position",
  87. "a_normal",
  88. "a_color",
  89. "a_tex_coord0",
  90. "a_tex_coord1",
  91. "a_tex_coord2",
  92. "a_tex_coord3"
  93. };
  94. const char* const SHADER_UNIFORM_NAMES[] =
  95. {
  96. "u_view",
  97. "u_model",
  98. "u_model_view",
  99. "u_model_view_projection",
  100. "u_time_since_start"
  101. };
  102. const size_t UNIFORM_SIZE_TABLE[UNIFORM_END] =
  103. {
  104. sizeof(int32_t) * 1,
  105. sizeof(int32_t) * 2,
  106. sizeof(int32_t) * 3,
  107. sizeof(int32_t) * 4,
  108. sizeof(float) * 1,
  109. sizeof(float) * 2,
  110. sizeof(float) * 3,
  111. sizeof(float) * 4,
  112. sizeof(float) * 9,
  113. sizeof(float) * 16
  114. };
  115. ShaderUniform name_to_stock_uniform(const char* uniform)
  116. {
  117. for (uint8_t i = 0; i < UNIFORM_COUNT; i++)
  118. {
  119. if (string::strcmp(uniform, SHADER_UNIFORM_NAMES[i]) == 0)
  120. {
  121. return (ShaderUniform) i;
  122. }
  123. }
  124. return UNIFORM_COUNT;
  125. }
  126. /// OpenGL renderer
  127. class RendererImplementation
  128. {
  129. public:
  130. //-----------------------------------------------------------------------------
  131. RendererImplementation()
  132. : m_max_texture_size(0), m_max_texture_units(0), m_max_vertex_indices(0), m_max_vertex_vertices(0),
  133. m_max_anisotropy(0.0f), m_num_uniforms(0)
  134. {
  135. m_min_max_point_size[0] = 0.0f;
  136. m_min_max_point_size[1] = 0.0f;
  137. m_min_max_line_width[0] = 0.0f;
  138. m_min_max_line_width[1] = 0.0f;
  139. }
  140. //-----------------------------------------------------------------------------
  141. ~RendererImplementation()
  142. {
  143. }
  144. //-----------------------------------------------------------------------------
  145. void init()
  146. {
  147. m_gl_context.create_context();
  148. #if defined(LINUX) || defined(WINDOW)
  149. GLenum err = glewInit();
  150. CE_ASSERT(err == GLEW_OK, "Failed to initialize GLEW");
  151. #endif
  152. GL_CHECK(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_max_texture_size));
  153. GL_CHECK(glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &m_max_texture_units));
  154. // GL_CHECK(glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &m_max_vertex_indices));
  155. // GL_CHECK(glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &m_max_vertex_vertices));
  156. GL_CHECK(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, &m_min_max_point_size[0]));
  157. // GL_CHECK(glGetFloatv(GL_LINE_WIDTH_RANGE, &m_min_max_line_width[0]));
  158. Log::i("OpenGL Vendor : %s", glGetString(GL_VENDOR));
  159. Log::i("OpenGL Renderer : %s", glGetString(GL_RENDERER));
  160. Log::i("OpenGL Version : %s", glGetString(GL_VERSION));
  161. Log::i("GLSL Version : %s", glGetString(GL_SHADING_LANGUAGE_VERSION));
  162. Log::d("Min Point Size : %f", m_min_max_point_size[0]);
  163. Log::d("Max Point Size : %f", m_min_max_point_size[1]);
  164. Log::d("Min Line Width : %f", m_min_max_line_width[0]);
  165. Log::d("Max Line Width : %f", m_min_max_line_width[1]);
  166. Log::d("Max Texture Size : %dx%d", m_max_texture_size, m_max_texture_size);
  167. Log::d("Max Texture Units : %d", m_max_texture_units);
  168. Log::d("Max Vertex Indices : %d", m_max_vertex_indices);
  169. Log::d("Max Vertex Vertices : %d", m_max_vertex_vertices);
  170. GL_CHECK(glDisable(GL_BLEND));
  171. GL_CHECK(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
  172. GL_CHECK(glBlendEquation(GL_FUNC_ADD));
  173. #if defined(LINUX) || defined(WINDOWS)
  174. // Point sprites enabled by default
  175. GL_CHECK(glEnable(GL_POINT_SPRITE));
  176. GL_CHECK(glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE));
  177. #endif
  178. Log::i("OpenGL Renderer initialized.");
  179. }
  180. //-----------------------------------------------------------------------------
  181. void shutdown()
  182. {
  183. m_gl_context.destroy_context();
  184. }
  185. //-----------------------------------------------------------------------------
  186. void render(RenderContext& context)
  187. {
  188. //RenderTargetId old_rt;
  189. //old_rt.id = INVALID_ID;
  190. uint8_t layer = 0xFF;
  191. for (uint32_t s = 0; s < context.m_num_states; s++)
  192. {
  193. const uint64_t key_s = context.m_keys[s];
  194. RenderKey key;
  195. key.decode(key_s);
  196. const RenderState& cur_state = context.m_states[s];
  197. const uint64_t flags = cur_state.m_flags;
  198. //const RenderTargetId& cur_rt = context.m_targets[layer];
  199. // Check if layer changed
  200. if (key.m_layer != layer)
  201. {
  202. layer = key.m_layer;
  203. // Viewport
  204. const ViewRect& viewport = context.m_viewports[layer];
  205. GL_CHECK(glViewport(viewport.m_x, viewport.m_y, viewport.m_width, viewport.m_height));
  206. // Clear frame/depth buffer
  207. const ClearState& clear = context.m_clears[layer];
  208. if (clear.m_flags & (CLEAR_COLOR | CLEAR_DEPTH))
  209. {
  210. GLbitfield gl_clear = (clear.m_flags & CLEAR_COLOR) ? GL_COLOR_BUFFER_BIT : 0;
  211. gl_clear |= (clear.m_flags & CLEAR_DEPTH) ? GL_DEPTH_BUFFER_BIT : 0;
  212. GL_CHECK(glClearColor(clear.m_color.r, clear.m_color.g, clear.m_color.b, clear.m_color.a));
  213. #if defined(LINUX) || defined(WINDOWS)
  214. GL_CHECK(glClearDepth(clear.m_depth));
  215. #elif defined(ANDROID)
  216. GL_CHECK(glClearDepthf(clear.m_depth));
  217. #endif
  218. GL_CHECK(glClear(gl_clear));
  219. }
  220. GL_CHECK(glEnable(GL_DEPTH_TEST));
  221. }
  222. // Scissor
  223. const ViewRect& scissor = context.m_scissors[layer];
  224. if (scissor.area() != 0)
  225. {
  226. GL_CHECK(glEnable(GL_SCISSOR_TEST));
  227. GL_CHECK(glScissor(scissor.m_x, scissor.m_y, scissor.m_width, scissor.m_height));
  228. }
  229. else
  230. {
  231. GL_CHECK(glDisable(GL_SCISSOR_TEST));
  232. }
  233. // Depth write
  234. if (flags & (STATE_DEPTH_WRITE))
  235. {
  236. GL_CHECK(glDepthMask(flags & STATE_DEPTH_WRITE));
  237. }
  238. // Color/Alpha write
  239. if (flags & (STATE_COLOR_WRITE | STATE_ALPHA_WRITE))
  240. {
  241. GLboolean cw = !!(flags & STATE_COLOR_WRITE);
  242. GLboolean aw = !!(flags & STATE_ALPHA_WRITE);
  243. GL_CHECK(glColorMask(cw, cw, cw, aw));
  244. }
  245. // Face culling
  246. if (flags & STATE_CULL_CW)
  247. {
  248. GL_CHECK(glEnable(GL_CULL_FACE));
  249. GL_CHECK(glCullFace(GL_BACK));
  250. }
  251. else if (flags & STATE_CULL_CCW)
  252. {
  253. GL_CHECK(glEnable(GL_CULL_FACE));
  254. GL_CHECK(glCullFace(GL_FRONT));
  255. }
  256. else
  257. {
  258. GL_CHECK(glDisable(GL_CULL_FACE));
  259. }
  260. // Bind GPU program
  261. if (cur_state.program.id != INVALID_ID)
  262. {
  263. const GPUProgram& gpu_program = m_gpu_programs[cur_state.program.index];
  264. GL_CHECK(glUseProgram(gpu_program.m_id));
  265. // Not necessarily here...
  266. gpu_program.commit();
  267. for (uint8_t uniform = 0; uniform < gpu_program.m_num_stock_uniforms; uniform++)
  268. {
  269. const GLint& uniform_location = gpu_program.m_stock_uniform_locations[uniform];
  270. const Mat4& view = context.m_view_matrices[layer];
  271. const Mat4& projection = context.m_projection_matrices[layer];
  272. switch (gpu_program.m_stock_uniforms[uniform])
  273. {
  274. case UNIFORM_VIEW:
  275. {
  276. GL_CHECK(glUniformMatrix4fv(uniform_location, 1, GL_FALSE, view.to_float_ptr()));
  277. break;
  278. }
  279. case UNIFORM_MODEL:
  280. {
  281. GL_CHECK(glUniformMatrix4fv(uniform_location, 1, GL_FALSE, cur_state.pose.to_float_ptr()));
  282. break;
  283. }
  284. case UNIFORM_MODEL_VIEW:
  285. {
  286. GL_CHECK(glUniformMatrix4fv(uniform_location, 1, GL_FALSE, (view *
  287. cur_state.pose).to_float_ptr()));
  288. break;
  289. }
  290. case UNIFORM_MODEL_VIEW_PROJECTION:
  291. {
  292. GL_CHECK(glUniformMatrix4fv(uniform_location, 1, GL_FALSE, (projection * view *
  293. cur_state.pose).to_float_ptr()));
  294. break;
  295. }
  296. case UNIFORM_TIME_SINCE_START:
  297. {
  298. GL_CHECK(glUniform1f(uniform_location, device()->time_since_start()));
  299. break;
  300. }
  301. default:
  302. {
  303. CE_ASSERT(false, "Oops, wrong stock uniform!");
  304. break;
  305. }
  306. }
  307. }
  308. }
  309. else
  310. {
  311. GL_CHECK(glUseProgram(0));
  312. }
  313. // Bind array buffers
  314. const VertexBufferId& vb = cur_state.vb;
  315. if (vb.id != INVALID_ID)
  316. {
  317. const VertexBuffer& vertex_buffer = m_vertex_buffers[vb.index];
  318. glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer.m_id);
  319. const GPUProgram& gpu_program = m_gpu_programs[cur_state.program.index];
  320. gpu_program.bind_attributes(vertex_buffer.m_format);
  321. }
  322. else
  323. {
  324. GL_CHECK(glBindBuffer(GL_ARRAY_BUFFER, 0));
  325. }
  326. const IndexBufferId& ib = cur_state.ib;
  327. if (ib.id != INVALID_ID)
  328. {
  329. const IndexBuffer& index_buffer = m_index_buffers[ib.index];
  330. uint32_t prim_type = (flags & STATE_PRIMITIVE_MASK) >> STATE_PRIMITIVE_SHIFT;
  331. GLenum gl_prim_type = PRIMITIVE_TYPE_TABLE[prim_type];
  332. GL_CHECK(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer.m_id));
  333. GL_CHECK(glDrawElements(gl_prim_type, index_buffer.m_index_count, GL_UNSIGNED_SHORT, 0));
  334. }
  335. else
  336. {
  337. GL_CHECK(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
  338. }
  339. // Bind textures
  340. {
  341. uint64_t flags = STATE_TEXTURE_0;
  342. for (uint32_t unit = 0; unit < STATE_MAX_TEXTURES; unit++)
  343. {
  344. const Sampler& sampler = cur_state.samplers[unit];
  345. if (sampler.sampler_id.id != INVALID_ID)
  346. {
  347. switch (sampler.flags & SAMPLER_MASK)
  348. {
  349. case SAMPLER_TEXTURE:
  350. {
  351. Texture& texture = m_textures[sampler.sampler_id.index];
  352. texture.commit(unit, sampler.flags);
  353. break;
  354. }
  355. default:
  356. {
  357. CE_ASSERT(false, "Oops, sampler unknown");
  358. break;
  359. }
  360. }
  361. }
  362. flags <<= 1;
  363. }
  364. }
  365. }
  366. GL_CHECK(glFinish());
  367. m_gl_context.swap_buffers();
  368. }
  369. private:
  370. GLContext m_gl_context;
  371. // Limits
  372. int32_t m_max_texture_size;
  373. int32_t m_max_texture_units;
  374. int32_t m_max_vertex_indices;
  375. int32_t m_max_vertex_vertices;
  376. float m_max_anisotropy;
  377. float m_min_max_point_size[2];
  378. float m_min_max_line_width[2];
  379. VertexBuffer m_vertex_buffers[CROWN_MAX_VERTEX_BUFFERS];
  380. IndexBuffer m_index_buffers[CROWN_MAX_INDEX_BUFFERS];
  381. Texture m_textures[CROWN_MAX_TEXTURES];
  382. Shader m_shaders[CROWN_MAX_SHADERS];
  383. GPUProgram m_gpu_programs[CROWN_MAX_GPU_PROGRAMS];
  384. uint32_t m_num_uniforms;
  385. Uniform m_uniforms[CROWN_MAX_UNIFORMS];
  386. RenderTarget m_render_targets[CROWN_MAX_RENDER_TARGETS];
  387. private:
  388. friend class Renderer;
  389. };
  390. //-----------------------------------------------------------------------------
  391. Renderer::Renderer(Allocator& a)
  392. : m_allocator(a), m_impl(NULL), m_thread("render-thread"), m_submit(&m_contexts[0]), m_draw(&m_contexts[1]),
  393. m_is_initialized(false), m_should_run(false)
  394. {
  395. m_impl = CE_NEW(a, RendererImplementation);
  396. }
  397. //-----------------------------------------------------------------------------
  398. Renderer::~Renderer()
  399. {
  400. CE_DELETE(m_allocator, m_impl);
  401. }
  402. //-----------------------------------------------------------------------------
  403. void Renderer::init_impl()
  404. {
  405. m_impl->init();
  406. }
  407. //-----------------------------------------------------------------------------
  408. void Renderer::shutdown_impl()
  409. {
  410. m_impl->shutdown();
  411. }
  412. //-----------------------------------------------------------------------------
  413. void Renderer::render_impl()
  414. {
  415. m_impl->render(*m_draw);
  416. m_draw->clear();
  417. }
  418. //-----------------------------------------------------------------------------
  419. void Renderer::create_vertex_buffer_impl(VertexBufferId id, size_t count, VertexFormat format, const void* vertices)
  420. {
  421. m_impl->m_vertex_buffers[id.index].create(count, format, vertices);
  422. }
  423. //-----------------------------------------------------------------------------
  424. void Renderer::create_dynamic_vertex_buffer_impl(VertexBufferId id, size_t count, VertexFormat format)
  425. {
  426. m_impl->m_vertex_buffers[id.index].create(count, format, NULL);
  427. }
  428. //-----------------------------------------------------------------------------
  429. void Renderer::update_vertex_buffer_impl(VertexBufferId id, size_t offset, size_t count, const void* vertices)
  430. {
  431. m_impl->m_vertex_buffers[id.index].update(offset, count, vertices);
  432. }
  433. //-----------------------------------------------------------------------------
  434. void Renderer::destroy_vertex_buffer_impl(VertexBufferId id)
  435. {
  436. m_impl->m_vertex_buffers[id.index].destroy();
  437. }
  438. //-----------------------------------------------------------------------------
  439. void Renderer::create_index_buffer_impl(IndexBufferId id, size_t count, const void* indices)
  440. {
  441. m_impl->m_index_buffers[id.index].create(count, indices);
  442. }
  443. //-----------------------------------------------------------------------------
  444. void Renderer::create_dynamic_index_buffer_impl(IndexBufferId id, size_t count)
  445. {
  446. m_impl->m_index_buffers[id.index].create(count, NULL);
  447. }
  448. //-----------------------------------------------------------------------------
  449. void Renderer::update_index_buffer_impl(IndexBufferId id, size_t offset, size_t count, const void* indices)
  450. {
  451. m_impl->m_index_buffers[id.index].update(offset, count, indices);
  452. }
  453. //-----------------------------------------------------------------------------
  454. void Renderer::destroy_index_buffer_impl(IndexBufferId id)
  455. {
  456. m_impl->m_index_buffers[id.index].destroy();
  457. }
  458. //-----------------------------------------------------------------------------
  459. void Renderer::create_texture_impl(TextureId id, uint32_t width, uint32_t height, PixelFormat format, const void* data)
  460. {
  461. m_impl->m_textures[id.index].create(width, height, format, data);
  462. }
  463. //-----------------------------------------------------------------------------
  464. void Renderer::update_texture_impl(TextureId id, uint32_t x, uint32_t y, uint32_t width, uint32_t height, const void* data)
  465. {
  466. m_impl->m_textures[id.index].update(x, y, width, height, data);
  467. }
  468. //-----------------------------------------------------------------------------
  469. void Renderer::destroy_texture_impl(TextureId id)
  470. {
  471. m_impl->m_textures[id.index].destroy();
  472. }
  473. //-----------------------------------------------------------------------------
  474. void Renderer::create_shader_impl(ShaderId id, ShaderType type, const char* text)
  475. {
  476. m_impl->m_shaders[id.index].create(type, text);
  477. }
  478. //-----------------------------------------------------------------------------
  479. void Renderer::destroy_shader_impl(ShaderId id)
  480. {
  481. m_impl->m_shaders[id.index].destroy();
  482. }
  483. //-----------------------------------------------------------------------------
  484. void Renderer::create_gpu_program_impl(GPUProgramId id, ShaderId vertex, ShaderId pixel)
  485. {
  486. Shader& vs = m_impl->m_shaders[vertex.index];
  487. Shader& ps = m_impl->m_shaders[pixel.index];
  488. m_impl->m_gpu_programs[id.index].create(vs, ps, m_impl->m_num_uniforms, m_impl->m_uniforms);
  489. }
  490. //-----------------------------------------------------------------------------
  491. void Renderer::destroy_gpu_program_impl(GPUProgramId id)
  492. {
  493. m_impl->m_gpu_programs[id.index].destroy();
  494. }
  495. //-----------------------------------------------------------------------------
  496. void Renderer::create_uniform_impl(UniformId id, const char* name, UniformType type, uint8_t num)
  497. {
  498. m_impl->m_uniforms[id.index].create(name, type, num);
  499. m_impl->m_num_uniforms++;
  500. }
  501. //-----------------------------------------------------------------------------
  502. void Renderer::update_uniform_impl(UniformId id, size_t size, const void* data)
  503. {
  504. m_impl->m_uniforms[id.index].update(size, data);
  505. }
  506. //-----------------------------------------------------------------------------
  507. void Renderer::destroy_uniform_impl(UniformId id)
  508. {
  509. m_impl->m_uniforms[id.index].destroy();
  510. m_impl->m_num_uniforms--;
  511. }
  512. // //-----------------------------------------------------------------------------
  513. // void Renderer::create_render_target_impl(RenderTargetId id, uint16_t width, uint16_t height, RenderTargetFormat format)
  514. // {
  515. // }
  516. // //-----------------------------------------------------------------------------
  517. // void Renderer::destroy_render_target_impl(RenderTargetId id)
  518. // {
  519. // }
  520. } // namespace crown