Bugzilla – Attachment 396 Details for
Bug 651
GL_INVALID_ENUM raised with glGetInteger(GL_MAX_TEXTURE_IMAGE_UNITS, ...) w/ Mesa3D 9.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
GL2 context creation
texture-units-gl2.c (text/plain), 1.88 KB, created by
Mark Raynsford
on 2012-12-08 13:01:36 CET
(
hide
)
Description:
GL2 context creation
Filename:
MIME Type:
Creator:
Mark Raynsford
Created:
2012-12-08 13:01:36 CET
Size:
1.88 KB
patch
obsolete
>#include <stdio.h> >#include <X11/X.h> >#include <X11/Xlib.h> >#include <X11/Xutil.h> >#include <GL/glx.h> >#include <GL/gl.h> > >#include "units.h" > >static void createGLWin(Display *dpy, int width, int height, Window *rWin, GLXContext *rCtx); >static void useGL(Display *dpy, Window win, GLXContext ctx, int width, int height); > >static void >doIt() >{ > Display *disp1; > Window win1; > GLXContext ctx1; > > disp1 = XOpenDisplay(NULL); > createGLWin(disp1, 200, 200, &win1, &ctx1); > if(0 != win1 && 0 != ctx1) { > useGL(disp1, win1, ctx1, 200, 200); > > glXMakeCurrent(disp1, 0, 0); > glXDestroyContext(disp1, ctx1); > } > XCloseDisplay(disp1); >} > >int >main(int argc, char **argv) >{ > doIt(); > return 0; >} > >/* attributes for a double buffered visual in RGBA format with at least > * 4 bits per color and a 16 bit depth buffer */ >static int attrListDbl[] = { GLX_RGBA, GLX_DOUBLEBUFFER, > GLX_RED_SIZE, 4, > GLX_GREEN_SIZE, 4, > GLX_BLUE_SIZE, 4, > GLX_DEPTH_SIZE, 16, > None }; > >void createGLWin(Display *dpy, int width, int height, Window *rWin, GLXContext *rCtx) >{ > int screen = DefaultScreen(dpy); > XVisualInfo *vi = glXChooseVisual(dpy, screen, attrListDbl); > Colormap cmap; > XSetWindowAttributes attr; > > /* create a GLX context */ > *rCtx = glXCreateContext(dpy, vi, 0, GL_TRUE); > /* create a color map */ > cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone); > attr.colormap = cmap; > attr.border_pixel = 0; > > /* create a window in window mode*/ > attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask | > StructureNotifyMask; > *rWin = XCreateWindow(dpy, RootWindow(dpy, vi->screen), > 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, > CWBorderPixel | CWColormap | CWEventMask, &attr); > > XMapRaised(dpy, *rWin); >} > >void useGL(Display *dpy, Window win, GLXContext ctx, int width, int height) >{ > glXMakeCurrent(dpy, win, ctx); > > testTextureUnits(); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 651
:
394
|
395
| 396 |
397
|
398
|
399