~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to progs/beos/GLInfo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Small app to display GL infos
2
 
 
3
 
#include <stdio.h>
4
 
#include <string.h>
5
 
 
6
 
#include <Application.h>
7
 
#include <Window.h>
8
 
#include <OutlineListView.h>
9
 
#include <ScrollView.h>
10
 
#include <GLView.h>
11
 
 
12
 
#include <String.h>
13
 
 
14
 
#include <GL/gl.h>
15
 
#include <GL/glu.h>
16
 
 
17
 
#define GLUT_INFO 1
18
 
#ifdef GLUT_INFO
19
 
        #include <GL/glut.h>
20
 
#endif
21
 
 
22
 
 
23
 
class GLInfoWindow : public BWindow 
24
 
{
25
 
public:
26
 
   GLInfoWindow(BRect frame);
27
 
   virtual bool   QuitRequested() { be_app->PostMessage(B_QUIT_REQUESTED); return true; }
28
 
   
29
 
private:
30
 
        BGLView                         *gl;
31
 
        BOutlineListView        *list;
32
 
        BScrollView                     *scroller;
33
 
};
34
 
 
35
 
 
36
 
class GLInfoApp : public BApplication
37
 
{
38
 
public:
39
 
   GLInfoApp();
40
 
private:
41
 
   GLInfoWindow      *window;
42
 
};
43
 
 
44
 
 
45
 
GLInfoApp::GLInfoApp()
46
 
   : BApplication("application/x-vnd.OBOS-GLInfo")
47
 
{
48
 
   window = new GLInfoWindow(BRect(50, 50, 350, 350));
49
 
}
50
 
 
51
 
GLInfoWindow::GLInfoWindow(BRect frame)
52
 
   : BWindow(frame, "OpenGL Info", B_TITLED_WINDOW, 0)
53
 
{
54
 
        BRect   r = Bounds();
55
 
        char *s;
56
 
        BString l;
57
 
 
58
 
        // Add a outline list view
59
 
        r.right -= B_V_SCROLL_BAR_WIDTH;
60
 
        list            = new BOutlineListView(r, "GLInfoList", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES);
61
 
        scroller        = new BScrollView("GLInfoListScroller", list, B_FOLLOW_ALL_SIDES,
62
 
                                                B_WILL_DRAW | B_FRAME_EVENTS, false, true);
63
 
                                                
64
 
        gl = new BGLView(r, "opengl", B_FOLLOW_ALL_SIDES, 0, BGL_RGB | BGL_DOUBLE);
65
 
        gl->Hide();
66
 
        AddChild(gl);
67
 
        AddChild(scroller);
68
 
        
69
 
        Show();
70
 
        
71
 
        LockLooper();
72
 
        
73
 
        // gl->LockGL();
74
 
        
75
 
        list->AddItem(new BStringItem("OpenGL", 0));
76
 
 
77
 
        s = (char *) glGetString(GL_VENDOR);
78
 
        if (s) {
79
 
                l = ""; l << "Vendor Name: " << s;
80
 
                list->AddItem(new BStringItem(l.String(), 1));
81
 
        }
82
 
 
83
 
        s = (char *) glGetString(GL_VERSION);
84
 
        if (s) {
85
 
                l = ""; l << "Version: " << s;
86
 
                list->AddItem(new BStringItem(l.String(), 1));
87
 
        }
88
 
        
89
 
        s = (char *) glGetString(GL_RENDERER);
90
 
        if (s) {
91
 
                l = ""; l << "Renderer Name: " << s;
92
 
                list->AddItem(new BStringItem(l.String(), 1));
93
 
        }
94
 
 
95
 
        s = (char *) glGetString(GL_EXTENSIONS);
96
 
        if (s) {
97
 
                list->AddItem(new BStringItem("Extensions", 1));
98
 
                while (*s) {
99
 
                        char extname[255];
100
 
                        int n = strcspn(s, " ");
101
 
                        strncpy(extname, s, n);
102
 
                        extname[n] = 0;
103
 
                        list->AddItem(new BStringItem(extname, 2));
104
 
                        if (! s[n])
105
 
                                break;
106
 
                        s += (n + 1);   // next !
107
 
                }
108
 
        }
109
 
 
110
 
        list->AddItem(new BStringItem("GLU", 0));
111
 
        s = (char *) gluGetString(GLU_VERSION);
112
 
        if (s) {
113
 
                l = ""; l << "Version: " << s;
114
 
                list->AddItem(new BStringItem(l.String(), 1));
115
 
        }
116
 
 
117
 
        s = (char *) gluGetString(GLU_EXTENSIONS);
118
 
        if (s) {
119
 
                list->AddItem(new BStringItem("Extensions", 1));
120
 
                while (*s) {
121
 
                        char extname[255];
122
 
                        int n = strcspn(s, " ");
123
 
                        strncpy(extname, s, n);
124
 
                        extname[n] = 0;
125
 
                        list->AddItem(new BStringItem(extname, 2));
126
 
                        if (! s[n])
127
 
                                break;
128
 
                        s += (n + 1);   // next !
129
 
                }
130
 
        }
131
 
 
132
 
#ifdef GLUT_INFO
133
 
        list->AddItem(new BStringItem("GLUT", 0));
134
 
        l = "API version: "; l << GLUT_API_VERSION;
135
 
        list->AddItem(new BStringItem(l.String(), 1));
136
 
#endif
137
 
 
138
 
        // gl->UnlockGL();
139
 
 
140
 
        UnlockLooper();
141
 
}
142
 
 
143
 
 
144
 
 
145
 
int main(int argc, char *argv[])
146
 
{
147
 
   GLInfoApp *app = new GLInfoApp;
148
 
   app->Run();
149
 
   delete app;
150
 
   return 0;
151
 
}