@@ -33,11 +33,11 @@ public enum SelectorType
3333 None
3434 }
3535
36- private List < ( VertexArrayObject vao , Area hitbox , SelectorType type ) > _vaos ;
36+ private List < ( Renderer vao , Area hitbox , SelectorType type ) > _vaos ;
3737
3838 public Selector ( )
3939 {
40- _vaos = new List < ( VertexArrayObject vao , Area hitbox , SelectorType type ) > ( ) ;
40+ _vaos = new List < ( Renderer vao , Area hitbox , SelectorType type ) > ( ) ;
4141 }
4242 public void Select ( Shape shape )
4343 {
@@ -53,7 +53,7 @@ public void Select(Shape shape)
5353 Width = shape . Width ,
5454 Height = shape . Height
5555 } ;
56- _vaos . Add ( ( new VertexArrayObject ( AreaToFloatArray ( hitbox ) , new uint [ ] { 0 , 1 , 2 , 3 } , PrimitiveType . LineLoop ) , hitbox , SelectorType . Edge ) ) ;
56+ _vaos . Add ( ( new Renderer ( AreaToFloatArray ( hitbox ) , new uint [ ] { 0 , 1 , 2 , 3 } , PrimitiveType . LineLoop ) , hitbox , SelectorType . Edge ) ) ;
5757
5858 // Move selector (top-left)
5959 hitbox = new Area
@@ -64,7 +64,7 @@ public void Select(Shape shape)
6464 Height = 10
6565 } ;
6666 if ( shape . IsMoveable )
67- _vaos . Add ( ( new VertexArrayObject ( AreaToFloatArray ( hitbox ) , new uint [ ] { 0 , 1 , 2 , 0 , 2 , 3 } , PrimitiveType . Triangles ) , hitbox , SelectorType . Move ) ) ;
67+ _vaos . Add ( ( new Renderer ( AreaToFloatArray ( hitbox ) , new uint [ ] { 0 , 1 , 2 , 0 , 2 , 3 } , PrimitiveType . Triangles ) , hitbox , SelectorType . Move ) ) ;
6868
6969 // Resize selector (bottom-right)
7070 hitbox = new Area
@@ -75,7 +75,7 @@ public void Select(Shape shape)
7575 Height = 10
7676 } ;
7777 if ( shape . IsResizeable )
78- _vaos . Add ( ( new VertexArrayObject ( AreaToFloatArray ( hitbox ) , new uint [ ] { 0 , 1 , 2 , 0 , 2 , 3 } , PrimitiveType . Triangles ) , hitbox , SelectorType . Resize ) ) ;
78+ _vaos . Add ( ( new Renderer ( AreaToFloatArray ( hitbox ) , new uint [ ] { 0 , 1 , 2 , 0 , 2 , 3 } , PrimitiveType . Triangles ) , hitbox , SelectorType . Resize ) ) ;
7979 }
8080 public static float [ ] AreaToFloatArray ( Area area )
8181 {
@@ -88,7 +88,7 @@ public void Draw(Vector2i clientSize)
8888 {
8989 GL . Enable ( EnableCap . LineSmooth ) ;
9090 GL . LineWidth ( 3.0f ) ;
91- foreach ( ( VertexArrayObject vao , Area _ , SelectorType type ) part in _vaos )
91+ foreach ( ( Renderer vao , Area _ , SelectorType type ) part in _vaos )
9292 {
9393 if ( part . type == SelectorType . Edge )
9494 part . vao . Draw ( clientSize , new Color4 ( 0 , 125 , 200 , 255 ) ) ;
@@ -101,7 +101,7 @@ public void Draw(Vector2i clientSize)
101101 public ( bool , SelectorType ? ) HitBox ( Vector2i mousePosition )
102102 {
103103 if ( _vaos . Count > 0 )
104- foreach ( ( VertexArrayObject _ , Area hitbox , SelectorType type ) part in _vaos )
104+ foreach ( ( Renderer _ , Area hitbox , SelectorType type ) part in _vaos )
105105 if ( part . hitbox . X < mousePosition . X && part . hitbox . X + part . hitbox . Width > mousePosition . X && part . hitbox . Y < mousePosition . Y && part . hitbox . Y + part . hitbox . Height > mousePosition . Y )
106106 return ( true , part . type ) ;
107107 return ( false , null ) ;
0 commit comments