Changeset 7fc5e27 in opengl-game for game-gui-glfw.cpp


Ignore:
Timestamp:
Sep 3, 2019, 7:07:39 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
b6e60b4
Parents:
1ce9afe
Message:

Change all game-gui function names to lower camel case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game-gui-glfw.cpp

    r1ce9afe r7fc5e27  
    1111bool GameGui_GLFW::s_keyDown[NUM_KEYS];
    1212
    13 string& GameGui_GLFW::GetError() {
     13string& GameGui_GLFW::getError() {
    1414   return GameGui_GLFW::s_errorMessage;
    1515}
    1616
    17 bool GameGui_GLFW::Init() {
     17bool GameGui_GLFW::init() {
    1818   GameGui_GLFW::s_errorMessage = "No error";
    1919   glfwSetErrorCallback(glfw_error_callback);
     20
     21   windowWidth = -1;
     22   windowHeight = -1;
    2023
    2124   return glfwInit() == GLFW_TRUE ? RTWO_SUCCESS : RTWO_ERROR;
    2225}
    2326
    24 void GameGui_GLFW::Shutdown() {
     27void GameGui_GLFW::shutdown() {
    2528   glfwTerminate();
    2629}
    2730
    28 void* GameGui_GLFW::CreateWindow(const string& title, unsigned int width, unsigned int height, bool fullscreen) {
     31void* GameGui_GLFW::createWindow(const string& title, int width, int height, bool fullscreen) {
    2932   GLFWwindow* window = nullptr;
    3033   GLFWmonitor* mon = nullptr;
     
    4952      const GLFWvidmode* vmode = glfwGetVideoMode(mon);
    5053
    51       width = vmode->width;
    52       height = vmode->height;
    53 
    54       // TODO: Should probably enable some way to retrieve this from outside this class
    55       // and print it out there
    56       cout << "Fullscreen resolution " << vmode->width << "x" << vmode->height << endl;
     54      windowWidth = vmode->width;
     55      windowHeight = vmode->height;
     56   } else {
     57      windowWidth = width;
     58      windowHeight = height;
    5759   }
    5860
    59    window = glfwCreateWindow(width, height, title.c_str(), mon, nullptr);
     61   window = glfwCreateWindow(windowWidth, windowHeight, title.c_str(), mon, nullptr);
    6062   //glfwMakeContextCurrent(window);
    6163
     
    6870}
    6971
    70 void GameGui_GLFW::DestroyWindow() {
     72void GameGui_GLFW::destroyWindow() {
    7173   // TODO: This function can throw some errors. They should be handled
    7274   glfwDestroyWindow(window);
     
    7577#ifdef GAMEGUI_INCLUDE_VULKAN
    7678
    77 bool GameGui_GLFW::CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) {
     79bool GameGui_GLFW::createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) {
    7880   return glfwCreateWindowSurface(instance, window, nullptr, surface) == VK_SUCCESS ?
    7981      RTWO_SUCCESS : RTWO_ERROR;
     
    8284#endif
    8385
    84 vector<const char*> GameGui_GLFW::GetRequiredExtensions() {
     86vector<const char*> GameGui_GLFW::getRequiredExtensions() {
    8587   uint32_t glfwExtensionCount = 0;
    8688   const char** glfwExtensions;
     
    9395}
    9496
    95 void GameGui_GLFW::GetWindowSize(int* width, int* height) {
    96    glfwGetFramebufferSize(window, width, height);
     97void GameGui_GLFW::getWindowSize(int* width, int* height) {
     98   // This function segfaults on OSX, check other platforms
     99   //glfwGetFramebufferSize(window, width, height);
     100
     101   *width = windowWidth;
     102   *height = windowHeight;
    97103}
    98104
Note: See TracChangeset for help on using the changeset viewer.