
"""A green rectangle should take up most of the screen."""

import pyglet
import glooey
import vecrec

print(__doc__)

window = pyglet.window.Window()
batch = pyglet.graphics.Batch()

rect = vecrec.Rect.from_pyglet_window(window)
rect.shrink(50)

glooey.drawing.Rectangle(rect, batch=batch)

@window.event
def on_draw():
    window.clear()
    batch.draw()


pyglet.app.run()


"""Two green rectangles should take up most of the screen."""

import pyglet
import glooey
import vecrec

print(__doc__)

window = pyglet.window.Window()
batch = pyglet.graphics.Batch()

full = vecrec.Rect.from_pyglet_window(window)
left = vecrec.Rect(full.left, full.bottom, full.width/2, full.height)
right = vecrec.Rect(full.left, full.bottom, full.width/2, full.height)
right.left = left.right
left.shrink(50)
right.shrink(50)

glooey.drawing.Rectangle(left, batch=batch)
glooey.drawing.Rectangle(right, batch=batch)

@window.event
def on_draw():
    window.clear()
    batch.draw()


pyglet.app.run()

Make sure GL_QUADS don't end up weirdly connected.
Make sure GL_QUADS don't end up weirdly connected.

  
- """A green rectangle should take up most of the screen."""
+ """Two green rectangles should take up most of the screen."""
  
  import pyglet
  import glooey
  import vecrec
  
  print(__doc__)
  
  window = pyglet.window.Window()
  batch = pyglet.graphics.Batch()
  
- rect = vecrec.Rect.from_pyglet_window(window)
+ full = vecrec.Rect.from_pyglet_window(window)
+ left = vecrec.Rect(full.left, full.bottom, full.width/2, full.height)
+ right = vecrec.Rect(full.left, full.bottom, full.width/2, full.height)
+ right.left = left.right
- rect.shrink(50)
+ left.shrink(50)
+ right.shrink(50)
  
- glooey.drawing.Rectangle(rect, batch=batch)
+ glooey.drawing.Rectangle(left, batch=batch)
+ glooey.drawing.Rectangle(right, batch=batch)
  
  @window.event
  def on_draw():
      window.clear()
      batch.draw()
  
  
  pyglet.app.run()
  
Make sure GL_QUADS don't end up weirdly connected.
## Code Before:

"""A green rectangle should take up most of the screen."""

import pyglet
import glooey
import vecrec

print(__doc__)

window = pyglet.window.Window()
batch = pyglet.graphics.Batch()

rect = vecrec.Rect.from_pyglet_window(window)
rect.shrink(50)

glooey.drawing.Rectangle(rect, batch=batch)

@window.event
def on_draw():
    window.clear()
    batch.draw()


pyglet.app.run()

## Instruction:
Make sure GL_QUADS don't end up weirdly connected.
## Code After:

"""Two green rectangles should take up most of the screen."""

import pyglet
import glooey
import vecrec

print(__doc__)

window = pyglet.window.Window()
batch = pyglet.graphics.Batch()

full = vecrec.Rect.from_pyglet_window(window)
left = vecrec.Rect(full.left, full.bottom, full.width/2, full.height)
right = vecrec.Rect(full.left, full.bottom, full.width/2, full.height)
right.left = left.right
left.shrink(50)
right.shrink(50)

glooey.drawing.Rectangle(left, batch=batch)
glooey.drawing.Rectangle(right, batch=batch)

@window.event
def on_draw():
    window.clear()
    batch.draw()


pyglet.app.run()
