Package org.lwjgl.opengl

Examples of org.lwjgl.opengl.PixelFormat


  protected Pbuffer init(final int width, final int height, final int texID) {
    Pbuffer pbuffer = null;

    try {
      pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), null, null);

      // Initialise state of the pbuffer context.
      pbuffer.makeCurrent();

      PbufferTest.initGLState(width, height, 0.5f);
View Full Code Here


  protected Pbuffer init(final int width, final int height, final int texID) {
    Pbuffer pbuffer = null;

    try {
      final RenderTexture rt = new RenderTexture(true, false, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
      pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), rt, null);

      // Initialise state of the pbuffer context.
      pbuffer.makeCurrent();

      PbufferTest.initGLState(width, height, 0.5f);
View Full Code Here

  public PbufferTest(final int renderMode) {
    try {
      //find displaymode
      mode = findDisplayMode(800, 600, 16);
      Display.setDisplayMode(mode);
      Display.create(new PixelFormat(16, 0, 0, 0, 0));

      glInit();

      if ( (Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0 ) {
        System.out.println("No Pbuffer support!");
View Full Code Here

   * Initializes the test
   */
  private void initialize() {
    try {
      //find displaymode
      pbuffer = new Pbuffer(512, 512, new PixelFormat(), null, null);
      mode = findDisplayMode(800, 600, 16);
      Display.setDisplayMode(mode);
      // start of in windowed mode
      Display.create();
//      gl = new GLWindow("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
View Full Code Here

  private void render() {
    if (pbuffer.isBufferLost()) {
        System.out.println("Buffer contents lost - will recreate the buffer");
        pbuffer.destroy();
  try {
          pbuffer = new Pbuffer(512, 512, new PixelFormat(), null, null);
          initPbuffer();
  } catch (LWJGLException e) {
    e.printStackTrace();
  }
    }
View Full Code Here

       * @throws Exception Failure to create display
       */
      private void createDisplay() throws Exception {
         try {
            // create display with alpha
            Display.create(new PixelFormat(8,8,0));
            alphaSupport = true;
         } catch (Exception e) {
            // if we couldn't get alpha, let us know
            alphaSupport = false;
             Display.destroy();
View Full Code Here

    Log.info("TargetDisplayMode: "+targetDisplayMode);
   
    AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
            try {
              PixelFormat format = new PixelFormat(8,8,0,samples);
             
              tryCreateDisplay(format);
              supportsMultiSample = true;
            } catch (Exception e) {
              Display.destroy();
             
              try {
                PixelFormat format = new PixelFormat(8,8,0);
               
                tryCreateDisplay(format);
                alphaSupport = false;
              } catch (Exception e2) {
                Display.destroy();
                // if we couldn't get alpha, let us know
                try {
                  tryCreateDisplay(new PixelFormat());
                } catch (Exception e3) {
                  Log.error(e3);
                }
              }
            }
View Full Code Here

      Log.info("TargetDisplayMode: " + targetDisplayMode);

      AccessController.doPrivileged(new PrivilegedAction() {
        public Object run() {
          int sample=8;
          PixelFormat format;
          while (!Display.isCreated()) {
            try {
              format = new PixelFormat(8, 8, 0,sample);
              if (SHARED_DRAWABLE == null) {
                Display.create(format);
              } else {
                Display.create(format, SHARED_DRAWABLE);
              }
              //System.out.println("Samples:"+sample);
            } catch (Exception e) {
              if(sample%2!=0
                sample--;
              else
                sample-=2;
              if(sample<0) break;
              //Log.error(e);
            }
          }

          if (!Display.isCreated()) {
            alphaSupport = false;
            Display.destroy();
            try {
              if (SHARED_DRAWABLE == null) {
                Display.create();
              } else {
                Display.create(new PixelFormat(),SHARED_DRAWABLE);
              }
            } catch (Exception x) {
              Log.error(x);
            }
          }
View Full Code Here

   *
   * @throws SlickException Indicates a failure to create the shared drawable
   */
  public static void enableSharedContext() throws SlickException {
    try {
      SHARED_DRAWABLE = new Pbuffer(64, 64, new PixelFormat(8, 0, 0), null);
    } catch (LWJGLException e) {
      throw new SlickException("Unable to create the pbuffer used for shard context, buffers not supported", e);
    }
  }
View Full Code Here

        try {
            if (_pbuffer != null) {
                giveBackContext();
                ContextManager.removeContext(_pbuffer);
            }
            final PixelFormat format = new PixelFormat(_settings.getAlphaBits(), _settings.getDepthBits(),
                    _settings.getStencilBits()).withSamples(_settings.getSamples())
                    .withBitsPerPixel(_settings.getColorDepth()).withStereo(_settings.isStereo());
            _pbuffer = new Pbuffer(_width, _height, format, _texture, null);
            final Object contextKey = _pbuffer;
            try {
View Full Code Here

TOP

Related Classes of org.lwjgl.opengl.PixelFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.