Your message dated Sun, 26 Jun 2016 22:28:37 +0000
with message-id <[email protected]>
and subject line Bug#827686: fixed in pink-pony 1.4.1-2
has caused the Debian Bug report #827686,
regarding pink-pony: port to glfw3
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
827686: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827686
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: pink-pony
Version: 1.4.1-1
Severity: wishlist
Tags: sid stretch patch

Hi,

At some point I would like to remove the old version of glfw which is
no longer maintained upstream. The last release was in 2013.

To do this I've ported pink-pony to glfw3. Most of the porting was
straightforward although I had to make some large changes to pass the
new GLFWwindow pointer to the various classes and ensure the keycodes
from the old config file work with GLFW3.

If you want I can upload this for you, along with the fix to #765489
which was committed to SVN in 2014 but never uploaded.

Thanks,
James
--- a/debian/SConstruct
+++ b/debian/SConstruct
@@ -8,7 +8,7 @@ env['LIBS'] = ['GLU', 'GL', 'protobuf', 'IL']
 env['CPPPATH'] = ['#', '#/src', '#/external/flextGL/', '/usr/include/OpenEXR']
 
 env.ParseConfig("pkg-config IlmBase --cflags --libs")
-env.ParseConfig("pkg-config libglfw --cflags --libs")
+env.ParseConfig("pkg-config glfw3 --cflags --libs")
 env.ParseConfig("pkg-config ftgl --cflags --libs")
 env.ParseConfig("pkg-config sigc++-2.0 --cflags --libs")
 env.ParseConfig("pkg-config SDL_mixer --cflags --libs")
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Games Team <[email protected]>
 Uploaders: Miriam Ruiz <[email protected]>
 Build-Depends: debhelper (>= 9), quilt, scons, pkg-config, dh-buildinfo,
- mesa-common-dev, libglu1-mesa-dev, libglfw-dev, libxrandr-dev, glee-dev,
+ mesa-common-dev, libglu1-mesa-dev, libglfw3-dev, libxrandr-dev, glee-dev,
  libilmbase-dev, libdevil-dev, libftgl-dev, libsigc++-2.0-dev,
  libprotobuf-dev (>= 2), protobuf-compiler (>= 2), libtinyxml-dev,
  libsdl1.2-dev, libsdl-mixer1.2-dev
--- /dev/null
+++ b/debian/patches/glfw3.patch
@@ -0,0 +1,697 @@
+Description: Port to GLFW 3
+ The most significant changes here are:
+ - Having to pass a GLFWwindow* around to various classes.
+ - The key_to_glfw3 function which is needed to allow key ids from old config
+   files to work with GLFW 3.
+Author: James Cowgill <[email protected]>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/external/flextGL/flextGL.c
++++ b/external/flextGL/flextGL.c
+@@ -2,7 +2,7 @@
+ /* Do not edit. */
+ 
+ #include "flextGL.h"
+-#include "GL/glfw.h"
++#include "GLFW/glfw3.h"
+ 
+ #include <stdio.h>
+ 
+@@ -14,11 +14,11 @@ extern "C" {
+ 
+ void flextLoadOpenGLFunctions(void);
+ 
+-int flextInit(void)
++int flextInit(GLFWwindow* window)
+ {
+   
+-    int major = glfwGetWindowParam(GLFW_OPENGL_VERSION_MAJOR);
+-    int minor = glfwGetWindowParam(GLFW_OPENGL_VERSION_MINOR);
++    int major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR);
++    int minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR);
+ 
+     flextLoadOpenGLFunctions();
+     
+--- a/external/flextGL/flextGL.h
++++ b/external/flextGL/flextGL.h
+@@ -6677,7 +6677,10 @@ extern int FLEXT_ARB_geometry_shader4;
+ extern int FLEXT_EXT_transform_feedback;
+ extern int FLEXT_EXT_texture_filter_anisotropic;
+ 
+-int flextInit(void);
++struct GLFWwindow;
++typedef struct GLFWwindow GLFWwindow;
++
++int flextInit(GLFWwindow* window);
+ 
+ #define FLEXT_MAJOR_VERSION 2
+ #define FLEXT_MINOR_VERSION 0
+--- a/src/Config.cc
++++ b/src/Config.cc
+@@ -4,7 +4,7 @@
+ Config::Config()
+     : width(800),
+       height(600),
+-      window_mode(GLFW_FULLSCREEN),
++      window_fullscreen(true),
+       fsaa_samples(4),
+       swap_interval(1),
+       polygon_mode(GL_FILL),
+@@ -108,7 +108,7 @@ void Config::set_value(string name, stri
+     
+     int ival = 0;
+     float fval = 0.0f;
+-    int winmodeval = GLFW_WINDOW;
++    bool winmodeval = false;
+     GLenum polymodeval = GL_FILL;
+     string sval = "";
+     V2f vec2val;
+@@ -153,9 +153,9 @@ void Config::set_value(string name, stri
+ 
+     if (value.find("window") != string::npos &&
+         value.find("window") < value.find(';')) {
+-        winmodeval = GLFW_WINDOW;
++        winmodeval = false;
+     } else {
+-        winmodeval = GLFW_FULLSCREEN;
++        winmodeval = true;
+     }
+ 
+     if (value.find("fill") != string::npos &&
+@@ -177,7 +177,7 @@ void Config::set_value(string name, stri
+     
+     if (name == "width") width = ival;        
+     else if (name == "height") height = ival;
+-    else if (name == "window_mode") window_mode = winmodeval;
++    else if (name == "window_mode") window_fullscreen = winmodeval;
+     else if (name == "fsaa_samples") fsaa_samples = ival;
+     else if (name == "swap_interval") swap_interval = ival;
+     else if (name == "polygon_mode") polygon_mode = polymodeval;
+@@ -321,7 +321,7 @@ bool Config::write_file(string filename)
+     os << "height = " << height << ";" << endl;
+     os << "swap_interval = " << swap_interval <<  ";" << endl;
+     os << "window_mode = ";
+-    if (window_mode == GLFW_WINDOW)
++    if (!window_fullscreen)
+         os << "window;" << endl;
+     else
+         os << "fullscreen;" << endl;
+--- a/src/Config.hh
++++ b/src/Config.hh
+@@ -10,7 +10,7 @@ class Config
+     
+     // Window properties:
+     int width, height;
+-    int window_mode;
++    bool window_fullscreen;
+     int fsaa_samples;
+     int swap_interval;
+     GLenum polygon_mode;
+--- a/src/Menu.cc
++++ b/src/Menu.cc
+@@ -7,21 +7,21 @@
+ 
+ Menu* Menu::callback_menu = NULL;
+ 
+-void GLFWCALL menu_mouse_callback(int button, int action)
++void menu_mouse_callback(GLFWwindow* window, int button, int action, int mods)
+ {
+     if (Menu::callback_menu != NULL)
+         Menu::callback_menu->mouse_callback(button, action);
+ }
+ 
+-void GLFWCALL menu_resize_callback(int width, int height)
++void menu_resize_callback(GLFWwindow* window, int width, int height)
+ {
+     if (Menu::callback_menu != NULL)
+         Menu::callback_menu->resize_callback(width, height);
+ }
+ 
+-void GLFWCALL menu_key_callback(int key, int state)
++void menu_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+ {
+-    if (state != GLFW_PRESS || Menu::callback_menu == NULL ) 
++    if (action != GLFW_PRESS || Menu::callback_menu == NULL )
+         return;
+ 
+     if (key == GLFW_KEY_SPACE)
+@@ -34,7 +34,7 @@ void GLFWCALL menu_key_callback(int key,
+ 
+ void Menu::toggle_fullscreen(void)
+ {
+-    config->window_mode = (config->window_mode == GLFW_WINDOW)?GLFW_FULLSCREEN:GLFW_WINDOW;
++    config->window_fullscreen = !config->window_fullscreen;
+     status = RESET;
+     running = false;    
+ }
+@@ -48,9 +48,9 @@ void Menu::toggle_music(void)
+ 
+ void Menu::mouse_callback(int button, int action)
+ {
+-    int x,y;
++    double x,y;
+ 
+-    glfwGetMousePos(&x, &y);
++    glfwGetCursorPos(window, &x, &y);
+ 
+     if (action == GLFW_PRESS) {
+         V2f pos(x,screen_size.y - y);
+@@ -84,10 +84,12 @@ void Menu::resize_callback(int width, in
+ #define TEXT_COLOR Color4f(1,1,1,0.5)
+ 
+ Menu::Menu (Config* config, 
+-            Skydome* skydome)
++            Skydome* skydome,
++            GLFWwindow* window)
+     : active_screen(MAIN_SCREEN),
+       config(config),
+       skydome(skydome),
++      window(window),
+       heightmap(NULL),
+       logo_button(config->resource_dir + "textures/logo.png"),
+       start_button("Start", config),
+@@ -136,7 +138,7 @@ Menu::Menu (Config* config,
+     load_levels(config->resource_dir + config->levels_file);
+ 
+     int w,h;
+-    glfwGetWindowSize(&w,&h);
++    glfwGetWindowSize(window, &w, &h);
+     resize_callback(w,h);
+ 
+     next_level(0);
+@@ -151,15 +153,14 @@ Menu::Menu (Config* config,
+ 
+ void Menu::setup_settings(void)
+ {
+-    GLFWvidmode vidmodes[100];
+-
+-    int modes_found = glfwGetVideoModes(vidmodes, 100);
++    int modes_found;
++    const GLFWvidmode* vidmodes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &modes_found);
+     
+     resolutions.resize(modes_found);
+ 
+     for (int i = 0; i < modes_found; ++i) {
+-        resolutions[i] = V2i(vidmodes[i].Width,
+-                             vidmodes[i].Height);
++        resolutions[i] = V2i(vidmodes[i].width,
++                             vidmodes[i].height);
+     }
+ 
+     // resolutions.push_back(V2i( 640, 480));
+@@ -187,7 +188,7 @@ void Menu::setup_settings(void)
+         particle_setting = 3;
+     }
+ 
+-    if (config->window_mode == GLFW_WINDOW) {
++    if (!config->window_fullscreen) {
+         fullscreen_setting = 0;
+     } else {
+         fullscreen_setting = 1;
+@@ -242,10 +243,10 @@ void Menu::load_settings(void)
+ 
+     if (fullscreen_setting == 0) {
+         fullscreen_text.set_text("Window");
+-        config->window_mode = GLFW_WINDOW;
++        config->window_fullscreen = false;
+     } else {
+         fullscreen_text.set_text("Fullscreen");
+-        config->window_mode = GLFW_FULLSCREEN;
++        config->window_fullscreen = true;
+     }
+ 
+     if (minimap_setting == 0) {
+@@ -693,16 +694,16 @@ void Menu::reload_level(string level)
+ 
+ Menu::MenuStatus Menu::run(void)
+ {
+-    if (config->window_mode == GLFW_FULLSCREEN)
+-        glfwEnable(GLFW_MOUSE_CURSOR);
++    if (config->window_fullscreen)
++        glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
+ 
+     status = START;
+     running = true;
+ 
+     callback_menu = this;
+-    glfwSetMouseButtonCallback(menu_mouse_callback);
+-    glfwSetWindowSizeCallback(menu_resize_callback);
+-    glfwSetKeyCallback(menu_key_callback);
++    glfwSetMouseButtonCallback(window, menu_mouse_callback);
++    glfwSetWindowSizeCallback(window, menu_resize_callback);
++    glfwSetKeyCallback(window, menu_key_callback);
+ 
+ 
+     while (running) {
+@@ -713,25 +714,26 @@ Menu::MenuStatus Menu::run(void)
+ 
+         draw();
+         
+-        glfwSwapBuffers();
++        glfwSwapBuffers(window);
++        glfwPollEvents();
+ 
+-        if (glfwGetKey( GLFW_KEY_ESC ) || 
+-            !glfwGetWindowParam( GLFW_OPENED )) {
++        if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS ||
++            glfwWindowShouldClose(window)) {
+             status = QUIT;
+             running = false;
+-        } else if (glfwGetKey(GLFW_KEY_ENTER)) {
++        } else if (glfwGetKey(window, GLFW_KEY_ENTER) == GLFW_PRESS) {
+             status = START;
+             running = false;
+         }
+     }
+ 
+-    glfwSetMouseButtonCallback(NULL);
+-    glfwSetWindowSizeCallback(NULL);
+-    glfwSetKeyCallback(NULL);
++    glfwSetMouseButtonCallback(window, NULL);
++    glfwSetWindowSizeCallback(window, NULL);
++    glfwSetKeyCallback(window, NULL);
+     callback_menu = NULL;
+ 
+-    if (config->window_mode == GLFW_FULLSCREEN)
+-        glfwDisable(GLFW_MOUSE_CURSOR);
++    if (config->window_fullscreen)
++        glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
+ 
+     return status;
+ }
+--- a/src/Menu.hh
++++ b/src/Menu.hh
+@@ -27,6 +27,7 @@ class Menu
+ 
+     Config* config;
+     Skydome* skydome;
++    GLFWwindow* window;
+ 
+     auto_ptr<Heightmap> heightmap;
+ 
+@@ -137,7 +138,8 @@ class Menu
+     void toggle_music(void);
+ 
+     Menu(Config* config, 
+-         Skydome* skydome);
++         Skydome* skydome,
++         GLFWwindow* window);
+ 
+     MenuStatus run(void);
+ 
+--- a/src/Pony.cc
++++ b/src/Pony.cc
+@@ -97,16 +97,116 @@ Color4f rgbColor(const Color4f& hsvColor
+     return rgbColor;
+ }
+ 
++// Converts a glfw2 keycode from the config file to a glfw3 keycode
++static int key_to_glfw3(int encoded_key)
++{
++    static const int keymap[] =
++    {
++        GLFW_KEY_ESCAPE,
++        GLFW_KEY_F1,
++        GLFW_KEY_F2,
++        GLFW_KEY_F3,
++        GLFW_KEY_F4,
++        GLFW_KEY_F5,
++        GLFW_KEY_F6,
++        GLFW_KEY_F7,
++        GLFW_KEY_F8,
++        GLFW_KEY_F9,
++        GLFW_KEY_F10,
++        GLFW_KEY_F11,
++        GLFW_KEY_F12,
++        GLFW_KEY_F13,
++        GLFW_KEY_F14,
++        GLFW_KEY_F15,
++        GLFW_KEY_F16,
++        GLFW_KEY_F17,
++        GLFW_KEY_F18,
++        GLFW_KEY_F19,
++        GLFW_KEY_F20,
++        GLFW_KEY_F21,
++        GLFW_KEY_F22,
++        GLFW_KEY_F23,
++        GLFW_KEY_F24,
++        GLFW_KEY_F25,
++        GLFW_KEY_UP,
++        GLFW_KEY_DOWN,
++        GLFW_KEY_LEFT,
++        GLFW_KEY_RIGHT,
++        GLFW_KEY_LEFT_SHIFT,
++        GLFW_KEY_RIGHT_SHIFT,
++        GLFW_KEY_LEFT_CONTROL,
++        GLFW_KEY_RIGHT_CONTROL,
++        GLFW_KEY_LEFT_ALT,
++        GLFW_KEY_RIGHT_ALT,
++        GLFW_KEY_TAB,
++        GLFW_KEY_ENTER,
++        GLFW_KEY_BACKSPACE,
++        GLFW_KEY_INSERT,
++        GLFW_KEY_DELETE,
++        GLFW_KEY_PAGE_UP,
++        GLFW_KEY_PAGE_DOWN,
++        GLFW_KEY_HOME,
++        GLFW_KEY_END,
++        GLFW_KEY_KP_0,
++        GLFW_KEY_KP_1,
++        GLFW_KEY_KP_2,
++        GLFW_KEY_KP_3,
++        GLFW_KEY_KP_4,
++        GLFW_KEY_KP_5,
++        GLFW_KEY_KP_6,
++        GLFW_KEY_KP_7,
++        GLFW_KEY_KP_8,
++        GLFW_KEY_KP_9,
++        GLFW_KEY_KP_DIVIDE,
++        GLFW_KEY_KP_MULTIPLY,
++        GLFW_KEY_KP_SUBTRACT,
++        GLFW_KEY_KP_ADD,
++        GLFW_KEY_KP_DECIMAL,
++        GLFW_KEY_KP_EQUAL,
++        GLFW_KEY_KP_ENTER,
++        GLFW_KEY_NUM_LOCK,
++        GLFW_KEY_CAPS_LOCK,
++        GLFW_KEY_SCROLL_LOCK,
++        GLFW_KEY_PAUSE,
++        GLFW_KEY_LEFT_SUPER,
++        GLFW_KEY_RIGHT_SUPER,
++        GLFW_KEY_MENU,
++    };
++
++    const int keymap_size = sizeof(keymap) / sizeof(int);
++
++    if (encoded_key >= 'a' && encoded_key <= 'z')
++    {
++        // Convert lowercase to uppercase
++        return encoded_key - 'a' + 'A';
++    }
++    else if (encoded_key >= ' ' && encoded_key <= '~')
++    {
++        // Other printable ASCII characters are left as is
++        return encoded_key;
++    }
++    else if (encoded_key >= 0x101 && encoded_key < 0x101 + keymap_size)
++    {
++        // Transform using mapping array
++        return keymap[encoded_key - 0x101];
++    }
++    else
++    {
++        // Invalid key
++        return 0;
++    }
++}
++
+ Pony::Pony(int i, Config* config, ParticleSystem* particle_system)
+     : pos(config->pony_start[i]),
+       angle(config->pony_start_angle[i]),
+       speed(config->pony_start_speed),
+       slope_angle(0),
+       camera_pos(pos-V2f(sin(angle), cos(angle))),
+-      up(config->pony_up[i]),
+-      down(config->pony_down[i]),
+-      left(config->pony_left[i]),
+-      right(config->pony_right[i]),
++      up(key_to_glfw3(config->pony_up[i])),
++      down(key_to_glfw3(config->pony_down[i])),
++      left(key_to_glfw3(config->pony_left[i])),
++      right(key_to_glfw3(config->pony_right[i])),
+       shader(config->resource_dir + config->pony_shader),
+       mesh(),
+       animation(config->resource_dir + "models/Pony-animated.pskeleton"),
+@@ -154,36 +254,35 @@ Pony::Pony(int i, Config* config, Partic
+ 
+ Pony::Decision PlayerPony::decide(PonyGame* game, int i)
+ {
++    GLFWwindow* window = game->screen()->get_window();
+     Decision decision = {0.0f, 0.0f};
+     float& accel = decision.acceleration;
+     float& steer = decision.steer;
+ 
+-    if (glfwGetKey(up) == GLFW_PRESS)
++    if (glfwGetKey(window, up) == GLFW_PRESS)
+         accel += 1.0;
+-    if (glfwGetKey(down) == GLFW_PRESS)
++    if (glfwGetKey(window, down) == GLFW_PRESS)
+         accel -= 1.0;
+ 
+-    if (glfwGetKey(left) == GLFW_PRESS)
++    if (glfwGetKey(window, left) == GLFW_PRESS)
+         steer += 1.0;
+-    if (glfwGetKey(right) == GLFW_PRESS)
++    if (glfwGetKey(window, right) == GLFW_PRESS)
+         steer -= 1.0;
+ 
+-    if (glfwGetJoystickParam(i,GLFW_PRESENT) == GL_TRUE) {
++    if (glfwJoystickPresent(i) == GL_TRUE) {
+ 
+-        float axes[10];
+-
+-        int n = glfwGetJoystickPos(i,axes,10);
++        int n;
++        const float* axes = glfwGetJoystickAxes(i, &n);
+ 
+         if (n >= 2) {
+ 
+-            if (fabs(axes[0]) < 0.2) axes[0] = 0.0;
++            if (fabs(axes[0]) >= 0.2)
++                steer -= axes[0] * 2;
+             //accel += axes[1];
+-            steer -= axes[0]*2;
+         }
+ 
+-        unsigned char buttons[20];
+-
+-        int button_count = glfwGetJoystickButtons(i, buttons, 20);
++        int button_count;
++        const unsigned char* buttons = glfwGetJoystickButtons(i, &button_count);
+ 
+         if (button_count >= 2) {
+             if (buttons[0] == GLFW_PRESS)
+--- a/src/PonyGame.cc
++++ b/src/PonyGame.cc
+@@ -156,7 +156,7 @@ bool PonyGame::start(PonyPoints& points)
+ 
+     cout << m_config->player_count << " ponies." << endl;
+ 
+-    GLboolean f1_pressed = glfwGetKey(GLFW_KEY_F1);
++    GLboolean f1_pressed = glfwGetKey(m_screen->get_window(), GLFW_KEY_F1);
+ 
+     ParticleExplosionSource explosion_source(particle_system);
+ 
+@@ -376,25 +376,26 @@ bool PonyGame::start(PonyPoints& points)
+ 
+         getErrors();
+         calc_fps();
+-        glfwSwapBuffers();
++        glfwSwapBuffers(m_screen->get_window());
++        glfwPollEvents();
+ 
+         // Check if still running
+         
+-        if(glfwGetKey( GLFW_KEY_ESC ) ||
+-           !glfwGetWindowParam( GLFW_OPENED )) {
++        if(glfwGetKey(m_screen->get_window(), GLFW_KEY_ESCAPE) ||
++           glfwWindowShouldClose(m_screen->get_window())) {
+             running = false;
+             run_game = false;
+             delay = 0.0;
+         }
+ 
+ 
+-        if (glfwGetKey(GLFW_KEY_F1) && !f1_pressed) {
++        if (glfwGetKey(m_screen->get_window(), GLFW_KEY_F1) && !f1_pressed) {
+             int current_volume = Mix_VolumeMusic(-1);
+             Mix_VolumeMusic(std::min(128, current_volume + 63) % 128);
+             m_config->music_volume = Mix_VolumeMusic(-1);
+         }
+ 
+-        f1_pressed = glfwGetKey(GLFW_KEY_F1);
++        f1_pressed = glfwGetKey(m_screen->get_window(), GLFW_KEY_F1);
+     }
+ 
+     return run_game;
+--- a/src/SplitScreen.cc
++++ b/src/SplitScreen.cc
+@@ -2,14 +2,15 @@
+ 
+ SplitScreen* active_screen = NULL;
+ 
+-void GLFWCALL screen_size_callback(int width, int height)
++void screen_size_callback(GLFWwindow* window, int width, int height)
+ {
+     if (active_screen != NULL)
+         active_screen->resize(width, height);
+ }
+ 
+-SplitScreen::SplitScreen(int width, int height, int subscreens)
+-    : size(width, height),
++SplitScreen::SplitScreen(GLFWwindow* window, int width, int height, int subscreens)
++    : window(window),
++      size(width, height),
+       subscreen_count(subscreens),
+       current(0)
+ {
+@@ -20,14 +21,14 @@ SplitScreen::~SplitScreen()
+ {
+     if (active_screen == this) {
+         active_screen = NULL;
+-        glfwSetWindowSizeCallback(NULL);
++        glfwSetWindowSizeCallback(window, NULL);
+     }
+ }
+ 
+ void SplitScreen::set_glfw_callback()
+ {
+     active_screen = this;
+-    glfwSetWindowSizeCallback(screen_size_callback);
++    glfwSetWindowSizeCallback(window, screen_size_callback);
+ }
+ 
+ void SplitScreen::split(int subscreens)
+--- a/src/SplitScreen.hh
++++ b/src/SplitScreen.hh
+@@ -6,6 +6,7 @@
+ 
+ class SplitScreen
+ {
++    GLFWwindow* window;
+     V2i size;
+ 
+     int subscreen_count;
+@@ -17,9 +18,14 @@ class SplitScreen
+     
+     public:
+ 
+-    SplitScreen(int width, int height, int subscreens);
++    SplitScreen(GLFWwindow* window, int width, int height, int subscreens);
+     ~SplitScreen();
+ 
++    GLFWwindow* get_window()
++    {
++        return window;
++    }
++
+     V2i get_size()
+     {
+         return size;
+--- a/src/cinquo.hh
++++ b/src/cinquo.hh
+@@ -1,9 +1,10 @@
+ #pragma once
+ 
+ #define ILUT_USE_OPENGL
++#define GLFW_INCLUDE_GLU
+ 
+ #include "flextGL.h"
+-#include <GL/glfw.h>
++#include <GLFW/glfw3.h>
+ #include <string>
+ #include <iostream>
+ #include <vector>
+--- a/src/main.cc
++++ b/src/main.cc
+@@ -33,21 +33,13 @@ int main(int argc, char** argv)
+     }
+     
+     glfwInit();
+-    glfwOpenWindowHint(GLFW_FSAA_SAMPLES, config.fsaa_samples);
+-
+-    glfwOpenWindow(config.width, config.height, // width, height
+-                   0, 0, 0, 0,                  // R, G, B, A
+-                   24, 8,                       // depth, stencil
+-                   config.window_mode);         // GLFW_WINDOW | GLFW_FULLSCREEN
+-
+-    glfwSetWindowTitle("Pink Pony <3");
+-    glfwSwapInterval(config.swap_interval);
+-
+-    if (!flextInit()) {
+-        return 1;
+-    }
+-    
+-    bool reset_video = false;
++    glfwWindowHint(GLFW_SAMPLES, config.fsaa_samples);
++    glfwWindowHint(GLFW_DEPTH_BITS, 24);
++    glfwWindowHint(GLFW_STENCIL_BITS, 8);
++
++    bool done_flext_init = false;
++    bool reset_video = true;
++    GLFWwindow* window = NULL;
+ 
+     Mix_Music* music = NULL;
+     start_music(&music, config.resource_dir + config.background_music);
+@@ -55,26 +47,32 @@ int main(int argc, char** argv)
+     while (running) {
+ 
+         if (reset_video) {
++            if (window != NULL)
++                glfwDestroyWindow(window);
+ 
+-            glfwTerminate();
+-
+-            glfwInit();
+-            glfwOpenWindowHint(GLFW_FSAA_SAMPLES, config.fsaa_samples);
+-            
+-            glfwOpenWindow(config.width, config.height, // width, height
+-                           0, 0, 0, 0,                  // R, G, B, A
+-                           24, 8,                       // depth, stencil
+-                           config.window_mode);         // GLFW_WINDOW | GLFW_FULLSCREEN
+-
+-            glfwSetWindowTitle("Pink Pony <3");
++            GLFWmonitor* fullscreen_monitor = NULL;
++            if (config.window_fullscreen)
++                fullscreen_monitor = glfwGetPrimaryMonitor();
++
++            window = glfwCreateWindow(config.width, config.height,
++                                      "Pink Pony <3",
++                                      fullscreen_monitor, NULL);
+             glfwSwapInterval(config.swap_interval);
++            glfwMakeContextCurrent(window);
++
++            if (window == NULL || (!done_flext_init && !flextInit(window))) {
++                cerr << "Error initializing GLFW / OpenGL" << endl;
++                glfwTerminate();
++                return 1;
++            }
+ 
+             reset_video = false;
++            done_flext_init = true;
+ 
+             getErrors();
+         }
+ 
+-        // We put everything between glfwOpenWindow & glfwTerminate
++        // We put everything between glfwCreateWindow & glfwTerminate
+         // between braces, so that stack variables that need a GL context
+         // are destructed, while the context still exists.
+         {
+@@ -85,7 +83,7 @@ int main(int argc, char** argv)
+             Menu::MenuStatus menu_status;
+         
+             {
+-                Menu menu(&config, &skydome);
++                Menu menu(&config, &skydome, window);
+ 
+                 menu_status = menu.run();
+             }
+@@ -124,7 +122,7 @@ int main(int argc, char** argv)
+                     int human_count = config.player_count - config.ai_count;
+                     if (human_count == 0) human_count = config.player_count;
+ 
+-                    SplitScreen screen(config.width, config.height, human_count);
++                    SplitScreen screen(window, config.width, config.height, human_count);
+                     screen.set_glfw_callback();
+ 
+                     PonyGame game(&screen,
+@@ -139,7 +137,7 @@ int main(int argc, char** argv)
+                 running = false;
+             }
+         
+-            if (!glfwGetWindowParam(GLFW_OPENED)) {
++            if (glfwWindowShouldClose(window)) {
+                 running = false;
+             }
+         }
diff --git a/debian/patches/series b/debian/patches/series
index fa3a1bc..89bde3b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 script.patch
 datadir.patch
 tinyxml.patch
+glfw3.patch

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
Source: pink-pony
Source-Version: 1.4.1-2

We believe that the bug you reported is fixed in the latest version of
pink-pony, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
James Cowgill <[email protected]> (supplier of updated pink-pony package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 26 Jun 2016 21:40:18 +0100
Source: pink-pony
Binary: pink-pony pink-pony-data pink-pony-dbg
Architecture: source
Version: 1.4.1-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Games Team <[email protected]>
Changed-By: James Cowgill <[email protected]>
Description:
 pink-pony  - 3D racing game with ponies
 pink-pony-data - 3D racing game with ponies - game data
 pink-pony-dbg - 3D racing game with ponies - debug
Closes: 765489 827686
Changes:
 pink-pony (1.4.1-2) unstable; urgency=medium
 .
   * Team upload.
 .
   [ Fabian Greffrath ]
   * Extend datadir.patch to fall back to /u/s/g/pink-pony if no
     resource_dir variable is set in ~/.config/pony.options.
     Thanks Matijs van Zuijlen. (Closes: #765489)
 .
   [ James Cowgill ]
   * Remove menu and xpm files per TC decision.
   * Bump standards to 3.9.8
   * Port to glfw 3. (Closes: #827686)
Checksums-Sha1:
 8e1db57c9f219eb78bc9ab87210a6e7627bcc02b 2333 pink-pony_1.4.1-2.dsc
 c7ba68b9b806b284c12e40556b4499387682cd05 69544 pink-pony_1.4.1-2.debian.tar.bz2
Checksums-Sha256:
 7470be47ff3416c75ac1ff693752d920b8a7c578c660ca225b14a0844a193f7e 2333 
pink-pony_1.4.1-2.dsc
 f6613c6b73fb8eb16e153bada9ebc2b902cc6d7918788fcf43354bfdfddca3e4 69544 
pink-pony_1.4.1-2.debian.tar.bz2
Files:
 b68115f2814be026d82fd454b38d819f 2333 games optional pink-pony_1.4.1-2.dsc
 6014d2b5fc6a3c59cbbca9525c2e32bb 69544 games optional 
pink-pony_1.4.1-2.debian.tar.bz2

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJXcFA1AAoJEMfxZ23qLQHvcIwP/23KrQ27b0HFwAtCcPX1/E+r
ejbpoFwnqviciy44IaXFnG0nY5KcsAyRYz4jv73nkuUQ9WmzdZHgbiA5eVaRhDaN
l63phtENTfteOscMhZbO5iaob2Zr511K60SDfr+vQT9EeYodceuqQpsb0NLFTa5A
L65+jgQ9zKf3SqfZIsy7TNCbE27Me3sGseCRThd0iEt/1ekAVJnFW1x7lsu6eEbr
+qazcGNaf5AjPMDtfUBKCsX5oxJPBN8+pGMNdbfI7HiNpkrGeXCxK30jQ128RmJw
9xlUCOKFW/aDRi5+hbngDOSz6y4MBSUG3+REy4adsY5OHTDGqzf/y4qbjEHFh1Eb
NUCsaKbS/SkOE4292EcFzsgW7O9fYeSrCFUb8g6EfHOFW/MracdQkCNFLhnwPQvx
j/FZe2qmhUXUwG9J2HE3sls/u49NQw4nDDVHM1lZbFupU8Ob7dDS7w1152LjD9on
RPnr7MXMJEi+ANpIcDABSzaJ2Gh5PR9Nlp635FthN+6PWXGOmX/RiDVo3ABneurB
3QYhAiIXmGGjlKvoRohTBRxoSW5oiKTDyBPNejticHqK50bqJP++4ycaMVullgY6
scZqrAZ3Ur3+j+pg4YI70u9TiN/Fc8FPt7yOvMGp7yb9He/LCnyhSd1ER3Hnz3aR
uChfrDwKEM/zjKalk1s9
=PEMa
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to