13.07.2015 Views

OpenGL ES* 1.0 Framework Software Developer's Guide

OpenGL ES* 1.0 Framework Software Developer's Guide

OpenGL ES* 1.0 Framework Software Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RFiguresFigure 1. Intel ® 2700G Multimedia Accelerator Reference Platform....................................9Figure 2. Portrait Display Orientation.................................................................................10Figure 3. Left-handed Landscape Display Orientation ......................................................11Figure 4. Right-handed Landscape Display Orientation ....................................................11Figure 5. Tiling Example....................................................................................................13Figure 6. Pseudo-code to detect power management events...........................................27TablesTable 1. <strong>OpenGL</strong> ES Functions Supported in the Common-Lite Profile ...........................17Table 2. <strong>OpenGL</strong> ES Native Platform Graphics Interface (EGL) Supported Functions ....22Table 3. <strong>OpenGL</strong> ES Supported States ............................................................................23Table 4. Texture Environment Function Extensions..........................................................25Table 5. Specific Compressed Texture Formats...............................................................264 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


RThis page is intentionally left blank.6 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


IntroductionR1 IntroductionThe intent of this specification is to provide an introduction to 3D graphics programming using the<strong>OpenGL</strong>* Embedded Systems (<strong>OpenGL</strong> <strong>ES*</strong>) <strong>1.0</strong> implementation for the Intel ® 2700GMultimedia Accelerator. <strong>OpenGL</strong> ES <strong>1.0</strong> is a low-level, lightweight applications programminginterface (API) for advanced embedded graphics using well-defined subset profiles of <strong>OpenGL</strong>. Itprovides a low-level API between software applications and hardware or software graphicsengines.1.1 TerminologyTermDescriptionAPIGAPI<strong>OpenGL</strong> (OGL)<strong>OpenGL</strong> ESEGLPocketPCApplication Programming InterfaceMicrosoft Game APIOpen GL Application Programming InterfaceOpen GL for Embedded Systems Application Programming Interface<strong>OpenGL</strong> ES Platform Interface LayerMicrosoft specification for functionality of PDA-like devices. PocketPC2003 alsodescribes the operating system running on PocketPC devices.1.2 ReferencesReferenceIntel ® 2700G Multimedia Accelerator Product BriefIntel ® 2700G Multimedia Accelerator DatasheetIntel ® 2700G Multimedia Accelerator Display Management APIReferenceIntel ® 2700G Multimedia Accelerator Video API Reference<strong>OpenGL</strong>*Khronos* <strong>OpenGL</strong> Embedded Systems (<strong>OpenGL</strong> ES)Document No. / Location(http://www.intel.com/design/pca/prodbref/300571pb.htm)(http://www.intel.com/design/pca/companion/datashts/300948.htm)Available on premier.intel.comAvailable on premier.intel.comwww.opengl.orgwww.khronos.org<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 7


IntroductionR1.3 Architecture OverviewThe Intel ® 2700G Multimedia Accelerator family contains three components: Intel 2700G7Multimedia Accelerator with stacked package local memory, Intel 2700G5 MultimediaAccelerator for performance, Intel 2700G3 Multimedia Accelerator for value. The majordifferences between 2700G3 Multimedia Accelerator and 2700G5 Multimedia Acceleratorcomponents are the size of the on-die frame buffer and the power savings associated with usingthis frame buffer for display updates and refreshes. The 2700G7 is a stacked package containinglocal memory for space constrained applications. The 2700G5 Multimedia Accelerator isoptimized for a VGA (640x480) display and incorporates a 704 KB on-die frame buffer. The2700G3 Multimedia Accelerator is optimized for half-VGA and smaller displays and incorporatesa 384 KB on-die frame buffer. The 2700G family can support a maximum screen resolution of1280 x 1024.Note: The descriptions contained in this document apply to the 2700G3 Multimedia Accelerator, the2700G5 Multimedia Accelerator, and the 2700G7 Multimedia Accelerator, unless otherwisenoted. The term 2700G Multimedia Accelerator is used in this paper and refers to all of the abovenoted products.The 2700G Multimedia Accelerator 3D acceleration provides a complete hardware 3D renderingpipeline. This includes 831K triangles per second processing capability and 84 million pixels-persecond fill rate. Advanced 3D hardware acceleration includes features, such as texture and lightmapping, point, bilinear, trilinear and anisotropic filtering, alpha blending, dual texturing support,deferred texturing, screen tiling, texture compression, and full-screen anti-aliasing.The 2700G Multimedia Accelerator 2D acceleration includes support for clipping, anti-aliasing,alpha blending as well as a variety of BLT functions. The 2700G Multimedia Accelerator supportsall 256 raster operations (Source, Pattern, and Destination) defined by Microsoft*.8 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


IntroductionR1.3.1 Typical configurationsThe 2700G Multimedia Accelerator is designed to be used in embedded applications where powerconsumption, size, and price are of concern. The two most common platforms for the 2700GMultimedia Accelerator are likely to be Personal Digital Assistant (PDA) and Cellular PhoneHandsetPersonal Digital Assistant (PDA)The PDAs specified with the Intel 2700G Multimedia Accelerator will typically be high-endindustry leading configurations.A typical configuration for 2004-2005 will consist of:• at least 128 MB SDRAM• 16-bit color VGA resolution (640x480) 3.5” touch-sensitive LCD display,• AC-97 audio with internal speaker and headphone jack• Standard PocketPC controls (Navigation button, 4 program buttons, jog-wheel/button, voicerecordbutton, power button)• Rotate-able display for portrait or landscape mode viewing• VGA output jack for dual-display support of up to 24-bit color and 1024x768 (XGA)• Expansion slot (ex. Compact Flash (CF) or Secure Digital (SD))• Optional CameraFigure 1. Intel ® 2700G Multimedia Accelerator Reference PlatformGame input on a PDA generally consists of the standard PocketPC controls – a 4-way directionalnavigation control, an action button, four program buttons, a jog wheel, and the touch-sensitiveLCD display.<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 9


IntroductionRCellular Phone HandsetThe cell phones specified with the 2700G Multimedia Accelerator in the 2004–2005 timeframemay be equipped with:• At least 64 MB SDRAM• 16-bit color QVGA resolution (240x320) to VGA resolution (640x480) 2.5” touch-sensitiveLCD display• AC-97 audio with internal speaker and headphone jack• Rotate-able display for portrait or landscape mode viewing• Standard Cell Phone Interface or Microsoft Smartphone Interface• 2–3 Mega-Pixel Camera• Optional Expansion slot (Secure Digital (SD))Other DevicesThere is a large world of other types of devices possible with the Intel 2700G MultimediaAccelerator. Some of the other devices may include retail kiosks, portable gaming devices, orpersonal media devices. All manners of devices where an embedded processor solution isappropriate can be enhanced by the inclusion of a 2700G Multimedia Accelerator with its high-endcapabilities and low power consumption.1.3.2 Display RotationThe 2700G Multimedia Accelerator supports three dynamically selected display orientations. Thefollowing illustrations are based on the Intel 2700G Multimedia Accelerator Reference Platform.Figure 2. Portrait Display Orientation10 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


IntroductionRFigure 3. Left-handed Landscape Display OrientationFigure 4. Right-handed Landscape Display OrientationThe orientation can be selected through the operating system. An application developer may alsochoose to change the display orientation or to allow display rotation from within the application aswell.It is important for an application developer to keep the different possible screen orientations inmind when designing an application. The orientation may impact bitmap sizes, fonts, andviewports.An application should be configurable to support both landscape and portrait modes. Applicationsshould also be able to dynamically handle orientation change through <strong>OpenGL</strong> viewportmodification.Applications must also exit properly such that the OS can correctly restore the default viewingmodes.<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 11


IntroductionR1.4 Other APIs AvailableDisplay ConfigurationPlatforms using the 2700G Multimedia accelerator can display images on multiple monitors. Twoseparate images can be produced, allowing exciting usage models for PDAs and phones whenattached to external monitors and projectors.Power ManagementThere are several highly effective methods to enhance the power management features of the2700G Multimedia Accelerator including the ability to shut down portions of the LCD display;thus, preventing power consumption from refreshing unneeded pixels.VideoThe 2700G Multimedia Accelerator offers hardware acceleration for fast and power efficient videodecoding of VGA resolution video at 30 frames per second.For more information on any of these APIs, contact your Intel representative.12 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


3D FeaturesR2 3D FeaturesThe 2700G Multimedia Accelerator is a tile-based rendering device. The screen is divided intotiles. After being transformed and lit by the processor, 3D object data (triangles) are sent to the2700G Multimedia Accelerator. The 2700G Multimedia Accelerator tile accelerator determinesthe visibility of each triangle and arranges the triangles into tiles. The texturing engine thentextures, blends, fogs, and applies other effects to the 3D object data, and writes the final pixels tothe frame buffer for each tile.The 2700G Multimedia Accelerator offloads the processor and system bus of the compute andbandwidth intensive operations required for 3D texturing including: Z buffer compare, smallobject culling, off-screen culling, backface culling, tiling, texturing, filtering, and anti-aliasing.2.1 Screen TilingThe tiling accelerator divides each scene into blocks, and processes each block independently.This allows the driver and 2700G Multimedia Accelerator to process spatially local trianglestogether. This allows the graphics accelerator to process a much smaller data set (e.g., one tile at atime, as opposed to the whole scene). The 2700G can therefore perform much of the triangleprocessing internally for each tile; improving performance and reducing memory bandwidthrequirements.Figure 5. Tiling Example<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 13


3D FeaturesR2.2 CullingSeveral types of culling occur in the 2700G Multimedia Accelerator and driver to reduce thenumber of triangles that need to be processed by the core. These culling methods include:• Small Object Culling to remove triangles that are smaller than a pixel and would not be drawn• Off Screen Culling to remove triangles that are entirely located outside of the viewingfrustum.• Back Face Culling to remove triangles that are facing away from the user’s viewpoint andwould not be visible on screenIn addition to these hardware accelerated culling methods, software developers are stronglyencouraged to perform their own object-level culling to remove objects that fall outside of theviewing frustum in order to further reduce the number of polygons that need to be processed.2.3 Full Screen AntialiasingThe 2700G Multimedia Accelerator supports Full Screen Antialiasing (FSAA). To activate FSAAin <strong>OpenGL</strong> ES you must set the attribute EGL_SAMPLE_BUFFERS = 1 and theEGL_SAMPLES attribute equal to 2 for 2x1 multisampling or to 4 for 2x2 multisampling. Theseattributes are set using eglChooseConfig(). To then enable / disable the FSAA, use glEnable(GL_MULTISAMPLE) and glDisable (GL_MULTISAMPLE).2.4 Texturing2.4.1 Deferred TexturingDeferred texturing improves performance by texturing only those pixels that are visible. Becausethe graphics controller is working with small data sets (e.g., a tile), it can perform the Z-comparesfor each pixel to determine exactly what is visible before applying the appropriate texture(s) to thatpixel. This prevents pixels from inadvertently being textured multiple times. For alpha blendedtextures, more than one triangle may be visible.2.4.2 Multi-pass TexturingThe 2700G Multimedia Accelerator supports multi-pass texturing. Multi-pass texturing is atechnique designed to overlay multiple texture maps over an object so that you can providetexture-based special effects. An example of this is a base texture for the surface of a car followedby a layer that has lighting or shadowing followed by another layer that shows ‘road grime’, bulletholes, or scorching.14 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


3D FeaturesR2.4.3 Single-Pass Multi-texturingSingle-pass multi-texturing is a useful technique for creating rich visual effects by blending twotextures together during the same rendering pass. The 2700G Multimedia Accelerator can applytwo textures in a single pass.One of the most common examples of multi-texturing is Bump Mapping – where a ‘normal’(a normal is a vector orthogonal to the object ‘surface’) map texture is created where the RGBcolors are re-interpreted as XYZ unit vectors. These vectors are then applied to the surface as perpixelnormal values to vary the way the pixel is shaded by the light to create a feeling of surfacerelief or height variations (imagine a stucco wall). The 2700G Multimedia Accelerator nativelysupports and accelerates Dot3 Bumpmapping.2.4.4 Perspective Correct Texture SupportA textured polygon is generated by mapping a 2D texture pattern onto each pixel of the polygon.A texture map is applied like wallpaper pasted onto the polygon. Since polygons are rendered inperspective, it is important that texture be mapped in perspective as well. The 2700G MultimediaAccelerator accelerates the texture correction computations.2.4.5 Texture CompressionTexture Compression reduces the bandwidth and power required to deliver textures. With largertextures, higher color depth, and multiple textures, it becomes increasingly important to provide amechanism to compress textures and reduce system memory bus use. The 2700G MultimediaAccelerator uses a high-performance texture compression format to enable a larger number oftextures to fit in the same amount of local memory.2.4.6 MipmappingIt does not make sense to apply a rich, large texture to an object that appears to be far away andvery small in the viewing scene. Rather than providing a single texture, in a single resolution, foran object of a certain size being textured at a specific distance (Z), mipmapping allows anapplication to store several textures at varying resolutions (e.g., 1024x1024, 512x512, 256x256,128x128, 64x64, 32x32, etc.). The 2700G Multimedia Accelerator will pick the most appropriatetexture from the mipmap set for each pixel, based on the texture resolution required. This exacttexture selected, and the resulting color of the pixel is dependent on the filtering mode being used.<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 15


3D FeaturesR2.4.7 Texture Mapping and FilteringMany texture mapping and filtering modes are supported. Perspective correct mapping is alwaysperformed. As the map is fitted across the triangle, the map will be tiled. The way a texture iscombined with other object attributes is also definable.The 2700G Multimedia Accelerator supports up to twelve Levels-of-Detail (LODs) ranging in sizefrom 2048x2048 to 1x1 texels. (A texel is defined as a texture map element). Textures do not haveto be square.The 2700G Multimedia Accelerator <strong>OpenGL</strong> ES implementation supports six types of texturefiltering:• Point Sampling: Texel with coordinates nearest to the desired pixel is used. This mode onlyrequires one level-of-detail to be present.• Bilinear Filtering: A weighted average of the texels in a 2x2 area surrounding the desiredpixel is used. This mode only requires one level-of-detail to be present.• Point Mipmapping: This is used if many LODs are present. The nearest LOD is chosen andthe texel with coordinates nearest to the desired pixel is used.• Bilinear Mipmapping: This is used if many LODs are present. The nearest LOD is chosen anda weighted average of the texels in a 2x2 area surrounding the desired pixel is used.• Point Mipmapping Linear: This is used if many LODs are present. Two appropriate LODs areselected and within each LOD, the texel with coordinates nearest to the desired pixel isselected. The final texture value is generated by linear interpolation between the two texelsselected from each of the LODs.• Trilinear Mipmapping: This is used if many LODs are present. Two appropriate LODs areselected and a weighted average of a 2x2 area of texels surrounding the desired pixel in eachLOD is generated (four texels per LOD). The final texture value is generated by linearinterpolation between the two texels generated for each of the LODs. Trilinear mipmapping isused to minimize the visibility of LOD transitions across an object.16 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationR3 <strong>OpenGL</strong> ES <strong>Framework</strong>Implementation3.1 Overview<strong>OpenGL</strong> <strong>ES*</strong> is an API intended to support high-performance graphics with little overhead asrequired by embedded systems. There are three ‘profiles’ covered by the <strong>OpenGL</strong> ES <strong>1.0</strong>specification to allow for platform-specific implementations:• Common• Common-Lite• Safety CriticalThe Common and Common-Lite profiles are intended for use in consumer entertainment andrelated devices such as PDAs, cell phones, and game consoles by offering fully functional 3Dcapabilities with texture mapping. The Safety Critical implementation is intended for industrialapplications and consumer applications where high reliability and minimum footprint are essential.The 2700G Multimedia Accelerator drivers support the Common-Lite profile of the <strong>OpenGL</strong> ES<strong>1.0</strong> specification.For more information on the <strong>OpenGL</strong> ES specifications, the full documentation and header filescan be downloaded from Khronos* at http://www.khronos.org/opengles/spec.html3.2 Functions SupportedIn Table 1 and Table 2 the following notations apply:● = Supported API○ = Unsupported API.Table 1. <strong>OpenGL</strong> ES Functions Supported in the Common-Lite ProfileglActiveTextureglAlphaFuncglAlphaFuncxglBindTextureFunction Supported Special Considerations●○●●glBlendFunc ● SRC_ALPHA_SATURATE is not supportedglClearglClearColorglClearColorx●○●<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 17


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationRglClearDepthfglClearDepthxFunction Supported Special Considerations○●glClearStencil ○ Stencil operations will not return GL_ERROR eventhough stencil operations are not supportedglClientActiveTextureglColor4fglColor4xglColorMaskglColorPointer●○●○●glCompressedTexImage2D ● • Standard compressed textures decompresspalletized textures at load time into local memory.They conserve system memory for data files. Usageof 2700G Multimedia Accelerator local texturememory is not reduced.• Compressed texture extensions offer textures thatremain compressed in local memory and are used bythe 2700G Multimedia Accelerator in compressformat. The following extension compressed texturetypes are supported:⎯ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG⎯ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG⎯ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG⎯ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMGglCompressedTexSubImage2D ● • Standard compressed textures decompresspalletized textures at load time into local memory.They conserve system memory for data files. Theydo not reduce usage of 2700G MultimediaAccelerator local texture memory.glCopyTexImage2DglCopyTexSubImage2DglCullFaceglDeleteTexturesglDepthFuncglDepthMaskglDepthRangefglDepthRangexglDisableglDisableClientState●●●●●●○●●●• Compressed texture extensions offer textures thatremain compressed in local memory and are used bythe 2700G Multimedia Accelerator in compressformat. The following extension compressed texturetypes are supported:⎯ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG⎯ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG⎯ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG⎯ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG18 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationRFunction Supported Special ConsiderationsglDrawArrays ● The following primitives are optimized for the 2700GMultimedia Accelerator pipeline:• GL_POINTS• GL_LINE_STRIP• GL_LINE_LOOP• GL_LINES• GL_TRIANGLE_STRIP• GL_TRIANGLE_FAN• GL_TRIANGLESglDrawElements ● glDrawElements is the recommended draw API forbest 2700G Multimedia Accelerator performance.The following primitives are optimized for the 2700GMultimedia Accelerator pipeline:• GL_POINTS• GL_LINE_STRIP• GL_LINE_LOOP• GL_LINES• GL_TRIANGLE_STRIP• GL_TRIANGLE_FAN• GL_TRIANGLESglEnable ● GL_COLOR_LOGIC_OP – affects glLogicOp (seeglLogicOp for more information)GL_STENCIL_TEST – not supportedNot recommended to enable/disableGL_MULTISAMPLE during render loop for performancereasons.glEnableClientStateglFinishglFlushglFogfglFogfvglFogxglFogxvglFrontFaceglFrustumfglFrustumxglGenTexturesglGetErrorglGetIntegervglGetStringglHintglLightModelfglLightModelfvglLightModelx●●●○○●●●○●●●●●●○○●<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 19


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationRglLightModelxvglLightfglLightfvglLightxglLightxvglLineWidthFunction Supported Special Considerations●○○●●○glLineWidthx ● Line widths between 1 and 32 are supported ifGL_LINE_SMOOTH is not enabled. Line width isignored if GL_LINE_SMOOTH is enabled.glLoadIdentityglLoadMatrixfglLoadMatrixx●○●glLogicOp ● Do not use glLogicOp with Fogging. LogicOps andFogging are Mutually ExclusiveglMaterialfglMaterialfvglMaterialxglMaterialxvglMatrixModeglMultMatrixfglMultMatrixxglMultiTexCoord4fglMultiTexCoord4xglNormal3fglNormal3xglNormalPointerglOrthofglOrthoxglPixelStoreiglPointSize○○●●●○●○●○●●○●●○glPointSizex ● Point sizes between 1 and 32 are supported ifGL_POINT_SMOOTH is not enabled. Point size isignored if GL_POINT_SMOOTH is enabled.glPolygonOffsetglPolygonOffsetxglPopMatrixglPushMatrixglReadPixelsglRotatefglRotatexglSampleCoverageglSampleCoveragex○●●●●○●○●20 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationRglScalefglScalexglScissorglShadeModelFunction Supported Special Considerations○●●●glStencilFunc ○ Stencil operations will not return GL_ERROR eventhough stencil operations are not supportedglStencilMask ○ Stencil operations will not return GL_ERROR eventhough stencil operations are not supportedglStencilOp ○ Stencil operations will not return GL_ERROR eventhough stencil operations are not supportedglTexCoordPointerglTexEnvfglTexEnvfv●○○glTexEnvx ● Additional extensions supported:• GL_MODULATE_COLOR_IMG• GL_RECIP_ADD_SIGNED_ALPHA_IMG• GL_TEXTURE_ALPHA_MODULATE_IMG• GL_FACTOR_ALPHA_MODULATE_IMG• GL_FRAGMENT_ALPHA_MODULATE_IMG• GL_ADD_BLEND_IMG• GL_DOT3_RGBAglTexEnvxv ● Additional extensions supported:• GL_MODULATE_COLOR_IMG• GL_RECIP_ADD_SIGNED_ALPHA_IMG• GL_TEXTURE_ALPHA_MODULATE_IMG• GL_FACTOR_ALPHA_MODULATE_IMG• GL_FRAGMENT_ALPHA_MODULATE_IMG• GL_ADD_BLEND_IMG• GL_DOT3_RGBAglTexImage2DglTexParameterf●○glTexParameterx ● GL_TEXTURE_MAG_FILTER is not supportedglTexSubImage2DglTranslatefglTranslatexglVertexPointerglViewport●○●●●<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 21


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationRTable 2. <strong>OpenGL</strong> ES Native Platform Graphics Interface (EGL) Supported FunctionsFunction Supported Special ConsiderationseglChooseConfig ● EGL_STENCIL_SIZE is unsupportedeglCopyBufferseglCreateContexteglCreatePbufferSurfaceeglCreatePixmapSurfaceeglCreateWindowSurfaceeglDestroyContexteglDestroySurface●●○○●●●eglGetConfigAttrib ● EGL_MAX_PBUFFER_WIDTH,EGL_MAX_PBUFFER_HEIGHT,EGL_MAX_PBUFFER_PIXELS, andEGL_STENCIL_BITS are unsupportedeglGetConfigseglGetCurrentContexteglGetCurrentDisplayeglGetCurrentSurfaceeglGetDisplay●●●●●eglGetError ● Extended error code EGL_CONTEXT_LOST_IMGgenerated when power management event hasoccurred. See section 3.5 for more details.eglGetProcAddresseglInitializeeglMakeCurrenteglQueryContexteglQueryStringeglQuerySurfaceeglSwapBufferseglTerminateeglWaitGLeglWaitNative●●●●●●●●●●22 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationR3.3 States SupportedIn Table 3 bold italics indicates queriable interface. The “GL_” prefix for all state names havebeen removed for simplicity.Table 3. <strong>OpenGL</strong> ES Supported StatesACTIVE_TEXTURE ALIASED_LINE_WIDTH_RANGE ALIASED_POINT_SIZE_RANGEALPHA_BITS ALPHA_TEST ALPHA_TEST_FUNCALPHA_TEST_REF BLEND BLEND_DSTBLEND_SRC BLUE_BITS CLIENT_ACTIVE_TEXTURECOLOR_ARRAY COLOR_ARRAY_POINTER COLOR_ARRAY_SIZECOLOR_ARRAY_STRIDE COLOR_ARRAY_TYPE COLOR_CLEAR_VALUECOLOR_MATERIAL COLOR_WRITEMASK COMPRESSED_TEXTURE_FORMATSCULL_FACE CULL_FACE_MODE CURRENT_COLORCURRENT_NORMALCURRENT_TEXTURE_COORDSDEPTH_BITSDEPTH_CLEAR_VALUE DEPTH_FUNC DEPTH_RANGEDEPTH_TEST DEPTH_WRITEMASK DITHERFOG FOG_COLOR FOG_DENSITYFOG_END FOG_HINT FOG_MODEFOG_START FRONT_FACE GREEN_BITSIMPLEMENTATION_COLOR_READ_TYPE_OESIMPLEMENTATION_COLOR_READ_FORMAT_OESLIGHT0LIGHT1 LIGHT2 LIGHT3LIGHT4 LIGHT5 LIGHT6LIGHT7 LIGHTING LIGHT_MODEL_AMBIENTLIGHT_MODEL_TWO_SIDE LINE_SMOOTH LINE_SMOOTH_HINTLINE_WIDTH LINE_WIDTH_GRANULARITY LINE_WIDTH_RANGELOGIC_OP_MODE MATRIX_MODE MAX_ELEMENTS_INDICESMAX_ELEMENTS_VERTICES MAX_LIGHTS MAX_MODELVIEW_STACK_DEPTHMAX_PROJECTION_STACK_DEPTHMAX_TEXTURE_SIZEMAX_TEXTURE_STACK_DEPTHMAX_TEXTURE_UNITS MAX_VIEWPORT_DIMS MODELVIEW_MATRIXMODELVIEW_STACK_DEPTH NORMAL_ARRAY NORMAL_ARRAY_POINTERNORMAL_ARRAY_STRIDE NORMAL_ARRAY_TYPE NORMALIZENUM_COMPRESSED_TEXTURE_FORMATSPACK_ALIGNMENTPERSPECTIVE_CORRECTION_HINT<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 23


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationRPOINT_SIZE POINT_SIZE_GRANULARITY POINT_SIZE_RANGEPOINT_SMOOTH POINT_SMOOTH_HINT POLYGON_OFFSET_FACTORPOLYGON_OFFSET_FILL POLYGON_OFFSET_UNITS PROJECTION_MATRIXPROJECTION_STACK_DEPTH RED_BITS RESCALE_NORMALSCISSOR_BOX SCISSOR_TEST SHADE_MODELSMOOTH_LINE_WIDTH_GRANULARITYSMOOTH_POINT_SIZE_RANGESMOOTH_LINE_WIDTH_RANGESTEREOSMOOTH_POINT_SIZE_GRANULARITYSUBPIXEL_BITSTEXTURE_2D TEXTURE_BINDING_2D TEXTURE_COMPRESSION_HINTTEXTURE_COORD_ARRAYTEXTURE_COORD_ARRAY_STRIDETEXTURE_COORD_ARRAY_POINTERTEXTURE_COORD_ARRAY_TYPETEXTURE_COORD_ARRAY_SIZETEXTURE_MATRIXTEXTURE_STACK_DEPTH UNPACK_ALIGNMENT VERTEX_ARRAYVERTEX_ARRAY_POINTER VERTEX_ARRAY_SIZE VERTEX_ARRAY_STRIDEVERTEX_ARRAY_TYPEVIEWPORT24 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationR3.4 Texture Extensions SupportedTable 4. Texture Environment Function ExtensionsBaseInternalFormatMODULATE_COLOR _IMG tex funcRECIP_ADD_SIGNED_ALPHA_IMG tex funcTEXTURE_ALPHA_MODULATE_IMG tex funcFACTOR_ALPHA_MODULATE_IMG tex funcALPHACv = CfCv = CfCv = ZEROCv = ZEROAv = AsAv = (1-As) + Af – 0.5Av = AsAv = AcLUMINANCECv = CfCsCv = CfCv = CsCv = AcCsAv = AfAv = Af – 0.5Av = ONEAv = AcLUMINANCE_ALPHACv = CfCsAv = AsCv = CfAv = (1-As) + Af – 0.5Cv = AsCsAv = AsCv = AcCsAv = AcINTENSITYCv = CfCsCv = CfCv = AsCsCv = AcCsAv = AsAv = (1-As) + Af – 0.5Av = AsAv = AcRGBCv = CfCsCv = CfCv = CsCv = AcCsAv = AfAv = Af – 0.5Av = ONEAv = AcRGBACv = CfCsCv = CfCv = AsCsCv = AcCsAv = AsAv = (1-As) + Af – 0.5Av = AsAv = AcBaseInternalFormatFRAGMENT_ALPHA_MODULATE_IMG tex funcADD_BLEND_IMG tex funcDOT3_RGBA tex funcALPHACv = ZEROCv = CfUndefinedAv = AfAv = AfAsLUMINANCECv = AfCsCv = Cf + (1- Af)CsUndefinedAv = AfAv = AfLUMINANCE_ALPHACv = AfCsAv = AfCv = Cf + (1- Af)CsAv = AfAsUndefinedINTENSITYCv = AfCsCv = Cf + (1- Af)CsUndefinedAv = AfAv = AfAsRGBCv = AfCsCv = Cf + (1- Af)CsCv = Dot3(Cf,Cs)Av = AfAv = AfAv = Dot3(Cf,Cs)RGBACv = AfCsCv = Cf + (1- Af)CsCv = Dot3(Cf,Cs)Av = AfAv = AfAsAv = Dot3(Cf,Cs)NOTE: Lower case ‘v’ stands for the computed value. Lower case ‘f’ refers to the incoming fragment. Lowercase ‘s’ refers to the texture image. Lower case ‘c’ refers to the texture environment color.<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 25


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationRTable 5. Specific Compressed Texture FormatsCompressed Internal FormatBase Internal FormatGL_COMPRESSED_RGB_PVRTC_4BPPV1_IMGGL_COMPRESSED_RGB_PVRTC_2BPPV1_IMGGL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMGGL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMGRGBRGBRGBARGBAThe 2700G Multimedia Accelerator natively supports the PVRTC format for acceleratedrendering. This format provides high quality compression and can accelerate applicationperformance through a reduction in the bandwidth required for rendering. Texture compressionwill also reduce the memory footprint required for your application or allow for the usage ofhigher resolution textures.The compressed texture formats can only be created using the PowerVR* Texture CompressionTool (PVRTextureTool). This tool is provided in the 2700G Multimedia Accelerator SDKavailable on https://premier.intel.com.26 <strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong>


<strong>OpenGL</strong> ES <strong>Framework</strong> ImplementationR3.5 Power Management ExtensionsOn a handheld device, power management events such as sleep, resume from sleep, etc. can occurat any time while an application is running. The application may or may not have advanced noticethat such an event is going to occur. When the system returns from the power management event,the EGLContext will be invalid and all subsequent <strong>OpenGL</strong> calls on this context will have noeffect.To detect this state, upon return from a power management event, calls to eglSwapBuffers,eglCopyBuffer or eglMakeCurrent will fail and return EGL_FALSE. The application should calleglGetError and check for “EGL_CONTEXT_LOST_IMG”.If this error is detected, the application must destroy all contexts by calling eglDestroyContext foreach context. The application must then recreate contexts, restore GL states and objects, andreload surfaces prior to resuming the rendering loop.Note: The 2700G Multimedia Accelerator Reference Platform does not support the “sleep” event and,therefore, will not trigger the power management extensions.Figure 6. Pseudo-code to detect power management eventseglSwapBuffersif eglSwapBuffers failedthenif eglGetError returns EGL_CONTEXT_LOST_IMG//detected resume from sleep modethen{//release current context//release current EGL surfaces//shut down EGL//recreate current EGL surfaces//re-load textures and set states}//check if eglSwapBuffers works nowif eglSwapBuffers failsthen exit // something else is wrong}else{//eglSwapBuffers failed and not EGL_CONTEXT_LOST_IMGexit;}<strong>OpenGL</strong> <strong>ES*</strong> <strong>1.0</strong> <strong>Framework</strong> <strong>Software</strong> Developer’s <strong>Guide</strong> 27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!