~ubuntu-branches/ubuntu/precise/fltk1.1/precise

« back to all changes in this revision

Viewing changes to src/Fl_Gl_Choice.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2010-01-06 22:05:04 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100106220504-nwj8m1sa90s760yt
Tags: 1.1.10-2
* src/Makefile: link libfltk.so.1.1 against -lpthread, as fluid now
  otherwise fails to link on the Hurd (with complaints that libfltk.so.1
  contains undefined references to pthread_mutexattr_*).
* debian/source.lintian-overrides: retire per Lintian 2.3.1.  (See #553264.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: Fl_Gl_Choice.cxx 5190 2006-06-09 16:16:34Z mike $"
 
2
// "$Id: Fl_Gl_Choice.cxx 6811 2009-06-30 19:05:09Z matt $"
3
3
//
4
4
// OpenGL visual selection code for the Fast Light Tool Kit (FLTK).
5
5
//
324
324
  GLContext context =
325
325
    layer ? wglCreateLayerContext(hdc, layer) : wglCreateContext(hdc);
326
326
  if (context) {
327
 
    if (context_list && context_list[0]) 
 
327
    if (context_list && nContext) 
328
328
      wglShareLists(context_list[0], context);
329
329
    add_context(context);
330
330
  }
333
333
 
334
334
#  elif defined(__APPLE_QD__)
335
335
GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer) {
336
 
    GLContext context, shared_ctx = context_list ? context_list[0] : 0;
 
336
    GLContext context, shared_ctx = 0;
 
337
    if (context_list && nContext) shared_ctx = context_list[0];
337
338
    context = aglCreateContext( g->pixelformat, shared_ctx);
338
339
    if (!context) return 0;
339
340
    add_context((GLContext)context);
349
350
#  elif defined(__APPLE_QUARTZ__)
350
351
  // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
351
352
  GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer) {
352
 
    GLContext context, shared_ctx = context_list ? context_list[0] : 0;
 
353
    GLContext context, shared_ctx = 0;
 
354
    if (context_list && nContext) shared_ctx = context_list[0];
353
355
    context = aglCreateContext( g->pixelformat, shared_ctx);
354
356
    if (!context) return 0;
355
357
    add_context((GLContext)context);
365
367
#  else
366
368
 
367
369
GLContext fl_create_gl_context(XVisualInfo* vis) {
368
 
  GLContext shared_ctx = context_list ? context_list[0] : 0;
 
370
  GLContext shared_ctx = 0;
 
371
  if (context_list && nContext) shared_ctx = context_list[0];
369
372
  GLContext context = glXCreateContext(fl_display, vis, shared_ctx, 1);
370
373
  if (context)
371
374
    add_context(context);
414
417
#  ifdef WIN32
415
418
  wglMakeCurrent(0, 0);
416
419
#  elif defined(__APPLE_QD__)
 
420
  AGLContext ctx = aglGetCurrentContext();
 
421
  if (ctx) aglSetDrawable(ctx, NULL);    
417
422
  aglSetCurrentContext(0);
418
423
#  elif defined(__APPLE_QUARTZ__)
419
424
  // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
 
425
  AGLContext ctx = aglGetCurrentContext();
 
426
  if (ctx) aglSetDrawable(ctx, NULL);    
420
427
  aglSetCurrentContext(0);
421
428
#  else
422
429
  glXMakeCurrent(fl_display, 0, 0);
428
435
#  ifdef WIN32
429
436
  wglDeleteContext(context);
430
437
#  elif defined(__APPLE_QD__)
431
 
  aglSetCurrentContext( NULL );
432
 
  aglSetDrawable( context, NULL );    
433
438
  aglDestroyContext( context );
434
439
#  elif defined(__APPLE_QUARTZ__)
435
440
  // warning: the Quartz version should probably use Core GL (CGL) instead of AGL
436
 
  aglSetCurrentContext( NULL );
437
 
  aglSetDrawable( context, NULL );
438
441
  aglDestroyContext( context );
439
442
#  else
440
443
  glXDestroyContext(fl_display, context);
446
449
 
447
450
 
448
451
//
449
 
// End of "$Id: Fl_Gl_Choice.cxx 5190 2006-06-09 16:16:34Z mike $".
 
452
// End of "$Id: Fl_Gl_Choice.cxx 6811 2009-06-30 19:05:09Z matt $".
450
453
//