Project

General

Profile

« Previous | Next » 

Revision c7da4e65

Added by Leszek Koltunski about 7 years ago

Fix OutputSurface.resize(): before it couldn't be called mid-render.

View differences:

src/main/java/org/distorted/library/DistortedTexture.java
57 57

  
58 58
  void create()
59 59
    {
60
    if( mBmp!=null && mColorH !=null )
60
    if( mBmp!=null )
61 61
      {
62
      if( mColorH[0]==NOT_CREATED_YET )
62
      if( mColorCreated==NOT_CREATED_YET )
63 63
        {
64
        mColorCreated = CREATED;
64 65
        GLES30.glGenTextures(1, mColorH, 0);
65 66
        GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, mColorH[0]);
66 67
        GLES30.glTexParameteri ( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_MIN_FILTER, GLES30.GL_LINEAR );
......
84 85

  
85 86
  void delete()
86 87
    {
87
    if( mColorH !=null && mColorH[0]>=0 )
88
    if( mColorH[0]>=0 )
88 89
      {
89 90
      GLES30.glDeleteTextures(1, mColorH, 0);
90
      mColorH[0] = NOT_CREATED_YET;
91
      mColorH[0] = 0;
92
      mColorCreated = NOT_CREATED_YET;
91 93
      }
92 94
    }
93 95

  
......
96 98

  
97 99
  void recreate()
98 100
    {
99
    if( mColorH[0]!=DONT_CREATE ) mColorH[0] = NOT_CREATED_YET;
101
    if( mColorCreated!=DONT_CREATE ) mColorCreated = NOT_CREATED_YET;
100 102
    }
101 103

  
102 104
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff