gl.h 724 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * OpenHMD - Free and Open Source API and drivers for immersive technology.
  3. * Copyright (C) 2013 Fredrik Hultin.
  4. * Copyright (C) 2013 Jakob Bornecrantz.
  5. * Distributed under the Boost 1.0 licence, see LICENSE for full text.
  6. */
  7. /* OpenGL Test - Interface For GL Helper Functions */
  8. #ifndef GL_H
  9. #define GL_H
  10. #include <SDL.h>
  11. #include <GL/glew.h>
  12. #include <GL/gl.h>
  13. typedef struct {
  14. int w, h;
  15. SDL_Surface* screen;
  16. } gl_ctx;
  17. void ortho(gl_ctx* ctx);
  18. void perspective(gl_ctx* ctx);
  19. void init_gl(gl_ctx* ctx, int w, int h);
  20. void draw_cube();
  21. GLuint compile_shader(const char* vertex, const char* fragment);
  22. void create_fbo(int eye_width, int eye_height, GLuint* fbo, GLuint* color_tex, GLuint* depth_tex);
  23. #endif