/packages/ptc/src/x11/x11glxfbconfigd.inc

https://github.com/slibre/freepascal · Pascal · 65 lines · 24 code · 9 blank · 32 comment · 0 complexity · be420a043d9993d5b3ce0e3c843f4e63 MD5 · raw file

  1. {
  2. This file is part of the PTCPas framebuffer library
  3. Copyright (C) 2012 Nikolay Nikolov (nickysn@users.sourceforge.net)
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version
  8. with the following modification:
  9. As a special exception, the copyright holders of this library give you
  10. permission to link this library with independent modules to produce an
  11. executable, regardless of the license terms of these independent modules,and
  12. to copy and distribute the resulting executable under terms of your choice,
  13. provided that you also meet, for each linked independent module, the terms
  14. and conditions of the license of that module. An independent module is a
  15. module which is not derived from or based on this library. If you modify
  16. this library, you may extend this exception to your version of the library,
  17. but you are not obligated to do so. If you do not wish to do so, delete this
  18. exception statement from your version.
  19. This library is distributed in the hope that it will be useful,
  20. but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  22. Lesser General Public License for more details.
  23. You should have received a copy of the GNU Lesser General Public
  24. License along with this library; if not, write to the Free Software
  25. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  26. }
  27. {$IFDEF ENABLE_X11_EXTENSION_GLX}
  28. type
  29. TX11GLXFBConfig = class
  30. private
  31. FDisplay: PDisplay;
  32. FScreen: cint;
  33. FGLXFBConfig: TGLXFBConfig;
  34. FVisInfo: TXVisualInfo;
  35. FGLXContext: TGLXContext;
  36. FGLXWindow: TGLXWindow;
  37. FGLXWindowCreated: Boolean;
  38. FSGISwapInterval: Integer;
  39. FRenderingContextHasBeenMadeCurrentAtLeastOnce: Boolean;
  40. procedure ChooseFBConfig(const AAttr: IPTCOpenGLAttributes);
  41. procedure GetVisualFromFBConfig;
  42. procedure CreateRenderingContext;
  43. public
  44. constructor Create(ADisplay: PDisplay; AScreen: cint; const AAttr: IPTCOpenGLAttributes);
  45. destructor Destroy; override;
  46. procedure AttachToWindow(AWindow: TWindow);
  47. procedure MakeRenderingContextCurrent;
  48. procedure SwapBuffers;
  49. procedure SetSwapInterval(AInterval: Integer);
  50. function GetSwapInterval: Integer;
  51. end;
  52. {$ENDIF ENABLE_X11_EXTENSION_GLX}