عرض الرسومات باستخدام OpenGL ES
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوفر إطار عمل Android الكثير من الأدوات القياسية لإنشاء واجهات مستخدم تصويرية جذابة وعملية. ومع ذلك، إذا أردت مزيدًا من التحكم في ما يرسمه تطبيقك على الشاشة، أو كنت تغامر برسومات ثلاثية الأبعاد، فستحتاج إلى استخدام أداة مختلفة. تقدم واجهات برمجة التطبيقات OpenGL ES التي يوفّرها إطار عمل Android مجموعة من الأدوات لعرض رسومات متحركة متطورة تحدّ فقط من مخيلتك، ويمكن أن تستفيد أيضًا من تسريع وحدات معالجة الرسومات (GPU) المتوفّرة على العديد من أجهزة Android.
ترشدك هذه الفئة إلى أساسيات تطوير التطبيقات التي تستخدم OpenGL، بما في ذلك
الإعداد ورسم الكائنات ونقل العناصر المرسومة والاستجابة للإدخال باللمس.
يستخدم الرمز النموذجي في هذه الفئة واجهات برمجة التطبيقات OpenGL ES 2.0، وهو إصدار واجهة برمجة التطبيقات الذي يُنصح باستخدامه مع أجهزة Android الحالية. للحصول على مزيد من المعلومات حول إصدارات OpenGL ES، يُرجى الاطّلاع على دليل المطوِّرين OpenGL.
ملاحظة: احرص على عدم خلط طلبات البيانات من واجهة برمجة التطبيقات OpenGL ES 1.x مع طرق OpenGL
ES 2.0. واجهتا برمجة التطبيقات غير قابلتين للتبديل، وتؤدي محاولة استخدامهما معًا إلى الشعور بالإحباط والحزن.
دروس
- إنشاء بيئة OpenGL ES
- تعرَّف على كيفية إعداد تطبيق Android لتتمكن من رسم رسومات OpenGL.
- تحديد الأشكال
- يمكنك التعرّف على كيفية تحديد الأشكال وأهمية التعرّف على الوجوه و المتعرّجات.
- رسم الأشكال
- تعرَّف على كيفية رسم أشكال OpenGL في تطبيقك.
- تطبيق الإسقاط والكاميرا
- تعرَّف على طريقة استخدام عروض الإسقاط والكاميرا للحصول على منظور جديد للأجسام المرسومة.
- إضافة حركة
- تعرَّف على طريقة تنفيذ حركة أساسية وصور متحركة للعناصر المرسومة باستخدام OpenGL.
- الاستجابة لأحداث اللمس
- تعرَّف على كيفية إجراء التفاعل الأساسي مع رسومات OpenGL.
رمز نموذجي إضافي
لتنزيل عينات NDK، يمكنك الاطّلاع على عيّنات NDK.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Displaying graphics with OpenGL ES\n\nThe Android framework provides plenty of standard tools for creating attractive, functional\ngraphical user interfaces. However, if you want more control of what your application draws on\nscreen, or are venturing into three dimensional graphics, you need to use a different tool. The\nOpenGL ES APIs provided by the Android framework offers a set of tools for displaying high-end,\nanimated graphics that are limited only by your imagination and can also benefit from the\nacceleration of graphics processing units (GPUs) provided on many Android devices.\n\nThis class walks you through the basics of developing applications that use OpenGL, including\nsetup, drawing objects, moving drawn elements and responding to touch input.\n\nThe example code in this class uses the OpenGL ES 2.0 APIs, which is the recommended API version\nto use with current Android devices. For more information about versions of OpenGL ES, see the\n[OpenGL developer\nguide](/develop/ui/views/graphics/opengl/about-opengl#choosing-version).\n\n**Note:** Be careful not to mix OpenGL ES 1.x API calls with OpenGL\nES 2.0 methods! The two APIs are not interchangeable and trying to use them together only results in\nfrustration and sadness.\n\nLessons\n-------\n\n**[Build an OpenGL ES environment](/develop/ui/views/graphics/opengl/environment)**\n: Learn how to set up an Android application to be able to draw OpenGL graphics.\n\n**[Define shapes](/develop/ui/views/graphics/opengl/shapes)**\n: Learn how to define shapes and why you need to know about faces and winding.\n\n**[Draw shapes](/develop/ui/views/graphics/opengl/draw)**\n: Learn how to draw OpenGL shapes in your application.\n\n**[Apply projection and camera views](/develop/ui/views/graphics/opengl/projection)**\n: Learn how to use projection and camera views to get a new perspective on your drawn\n objects.\n\n**[Add motion](/develop/ui/views/graphics/opengl/motion)**\n: Learn how to do basic movement and animation of drawn objects with OpenGL.\n\n**[Respond to touch events](/develop/ui/views/graphics/opengl/touch)**\n: Learn how to do basic interaction with OpenGL graphics.\n\nAdditional sample code\n----------------------\n\nTo download NDK samples, see\n[NDK Samples](https://github.com/googlesamples/android-ndk/)."]]