1. 15 Jul, 2010 2 commits
  2. 14 Jul, 2010 6 commits
  3. 13 Jul, 2010 19 commits
    • Robert Bragg's avatar
      material: splits out all the state flushing code · 5e669703
      Robert Bragg authored
      This moves the code supporting _cogl_material_flush_gl_state into
      cogl-material-opengl.c as part of an effort to reduce the size of
      cogl-material.c to keep it manageable.
    • Robert Bragg's avatar
      material: split the texture unit management out · ddb9016b
      Robert Bragg authored
      In general cogl-material.c has become far to large to manage in one
      source file. As one of the ways to try and break it down this patch
      starts to move some of lower level texture unit state management out
      into cogl-material-opengl.c. The naming is such because the plan is to
      follow up and migrate the very GL specific state flushing code into the
      same file.
    • Robert Bragg's avatar
      material: copy_differences: handle copying fog state · 9e893e68
      Robert Bragg authored
      When the support for redirecting the legacy fog state through cogl
      material was added in 9b9e764d, the code to handle copying the fog
      state in _cogl_material_copy_differences was missed.
    • Neil Roberts's avatar
      Add a GL_GENERATE_MIPMAP fallback to the texture 2d and 3d backends · ceb57087
      Neil Roberts authored
      The CoglTexture2DSliced backend has a fallback for when the
      framebuffer extension is missing so it's not possible to use
      glGenerateMipmap. This involves keeping a copy of the upper-left pixel
      of the tex image so that we can temporarily enable GL_GENERATE_MIPMAP
      on the texture object and do a sub texture update by reuploading the
      contents of the first pixel. This patch copies that mechanism to the
      2D and 3D backends. The CoglTexturePixel structure which was
      previously internal to the sliced backend has been moved to
      cogl-texture-private.h so that it can be shared.
    • Emmanuele Bassi's avatar
      stage: Add the NO_CLEAR_ON_PAINT hint · 0cbfabcd
      Emmanuele Bassi authored
      Some apps or some use cases don't need to clear the stage on immediate
      rendering GPUs. A media player playing a fullscreen video or a
      tile-based game, for instance.
      These apps are redrawing the whole screen, so we can avoid clearing the
      color buffer when preparing to paint the stage, since there is no
      blending with the stage color being performed.
      We can add an private set of hints to ClutterStage, and expose accessors
      for each potential hint; the first hint is the 'no-clear' one.
    • Neil Roberts's avatar
      Make the material functions for setting the p wrap mode public · 984e04ca
      Neil Roberts authored
      Now that we have 3D texture support it makes sense to expose the wrap
      mode for the p coordinate.
    • Neil Roberts's avatar
      Rename the third texure coordinate from 'r' to 'p' · 192cfa7a
      Neil Roberts authored
      Using 'r' to name the third component is problematic because that is
      commonly used to represent the red component of a vector representing
      a color. Under GLSL this is awkward because the texture swizzling for
      a vector uses a single letter for each component and the names for
      colors, textures and positions are synonymous. GLSL works around this
      by naming the components of the texture s, t, p and q. Cogl already
      effectively already exposes this naming because it exposes GLSL so it
      makes sense to use that naming consistently. Another alternative could
      be u, v and w. This is what Blender and Direct3D use. However the w
      component conflicts with the w component of a position vertex.
    • Neil Roberts's avatar
      Add a Cogl texture 3D backend · dfea57b4
      Neil Roberts authored
      This adds a publicly exposed experimental API for a 3D texture
      backend. There is a feature flag which can be checked for whether 3D
      textures are supported. Although we require OpenGL 1.2 which has 3D
      textures in core, GLES only provides them through an extension so the
      feature can be used to detect that.
      The textures can be created with one of two new API functions :-
      There is also internally a new_from_bitmap function. new_from_data is
      implemented in terms of this function.
      The two constructors are effectively the only way to upload data to a
      3D texture. It does not work to call glTexImage2D with the
      GL_TEXTURE_3D target so the virtual for cogl_texture_set_region does
      nothing. It would be possible to make cogl_texture_get_data do
      something sensible like returning all of the images as a single long
      image but this is not currently implemented and instead the virtual
      just always fails. We may want to add API specific to the 3D texture
      backend to get and set a sub region of the texture.
      All of those three functions can throw a GError. This will happen if
      the GPU does not support 3D textures or it does not support NPOTs and
      an NPOT size is requested. It will also fail if the FBO extension is
      not supported and the COGL_TEXTURE_NO_AUTO_MIPMAP flag is not
      given. This could be avoided by copying the code for the
      GL_GENERATE_MIPMAP TexParameter fallback, but in the interests of
      keeping the code simple this is not yet done.
      This adds a couple of functions to cogl-texture-driver for uploading
      3D data and querying the 3D proxy
      texture. prep_gl_for_pixels_upload_full now also takes sets the
      GL_UNPACK_IMAGE_HEIGHT parameter so that 3D textures can have padding
      between the images. Whenever 3D texture is uploading, both the height
      of the images and the height of all of the data is specified (either
      explicitly or implicilty from the CoglBitmap) so that the image height
      can be deduced by dividing by the depth.
    • Neil Roberts's avatar
      configure: Include gl2ext.h or glext.h under GLES · 8ccf8f6f
      Neil Roberts authored
      Under big GL, glext.h is included automatically by gl.h. However under
      GLES this doesn't appear to happen so it has to be included explicitly
      to get the defines for extensions. This patch changes the
      clutter_gl_header to be called cogl_gl_headers and it can now take a
      space seperated list of multiple headers. This is then later converted
      to a list of #include lines which ends up cogl-defines.h. The gles2
      and gles1 backends now add their respective ext header to this list.
    • Neil Roberts's avatar
      Make a public CoglBitmapError enum · 8940c306
      Neil Roberts authored
      There are many places in the texture backend that need to do
      conversion using the CoglBitmap code. Currently none of these
      functions can throw an error but they do return a value to indicate
      failure. In future it would make sense if new texture functions could
      throw an error and in that case they would want to use a CoglBitmap
      error if the failure was due to the conversion. This moves the
      internal CoglBitmap error from the quartz backend to be public in
      cogl-bitmap.h so that it can be used in this way.
    • Neil Roberts's avatar
      Neil Roberts authored
      We can use this error in more unsupported situations than just when we
      have a Cogl feature flag for the error. For example if a non-sliced
      texture is created with dimensions that are too large then we could
      throw this error. Therefore it seems good to rename to something more
    • Neil Roberts's avatar
      Move _cogl_texture_2d_is_pot to cogl-util.h · 423f7128
      Neil Roberts authored
      This function could be used in many places in Cogl so it makes sense
      to share it in cogl-util.h as _cogl_util_is_pot().
    • Neil Roberts's avatar
      cogl-gles2-wrapper: Layers aren't equal if one is enabled and one is not · 31c127bf
      Neil Roberts authored
      Previously when comparing whether the settings for a layer are equal
      it would only check if one of them was enabled. If so then it would
      assume the other one was enabled and continue to compare the texture
      environment. Now it also checks whether the enabledness differs.
    • Emmanuele Bassi's avatar
      x11: Use XKB to translate keycodes into key symbols · 6c913aa5
      Emmanuele Bassi authored
      And fall back to XKeycodeToKeysym() if XKB is not available.
    • Emmanuele Bassi's avatar
      x11: Use XKB to track the Locks state · 1ea4c500
      Emmanuele Bassi authored
      For Caps Lock and Num Lock. Store the state of both in the
      platform-specific per-event data structure. No accessors, yet.
    • Emmanuele Bassi's avatar
      x11: Use XKB detectable auto-repeat · bf2f8d67
      Emmanuele Bassi authored
      If we have XKB support then we should be using it to turn on the
      detectable auto-repeat; this allows avoiding the peeking trick
      that emulates it inside the event handling code.
    • Emmanuele Bassi's avatar
      x11: Add a Keymap ancillary object · bea657d3
      Emmanuele Bassi authored
      We should try to abstract everything that is related with the key mapping
      to its own object, to avoid complicating ClutterBackendX11 any further.
    • Emmanuele Bassi's avatar
      x11: Store the group inside the event platform data · d345a61e
      Emmanuele Bassi authored
      Now that we have private, per-event platform data, we can start putting
      it to good use. The first, most simple use is to store the key group
      given the event's modifiers. Since we assume a modern X11, we use XKB
      to retrieve it, or we simply fall back to 0 by default.
      The data is exposed as a ClutterX11-specific function, within the
      sanctioned clutter_x11_* namespace.
    • Emmanuele Bassi's avatar
      events: Add platform-data to allocated Events · f44ccba4
      Emmanuele Bassi authored
      Events allocated by Clutter should have a pointer to platform-specific
      data; this would allow backends to add separate structures for holding
      ancillary data, whilst retaining the ClutterEvent structure for use on
      the stack.
      In theory, for Clutter 2.x we might just want to drop Event and use an
      opaque structure, or a typed data structure inheriting from
      GTypeInstance instead.
  4. 12 Jul, 2010 1 commit
  5. 09 Jul, 2010 12 commits