Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:58:00+00:00 2026-06-06T13:58:00+00:00

This is my code: package hello.project; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.opengl.GLSurfaceView.Renderer;

  • 0

This is my code:

package hello.project;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.opengl.GLSurfaceView.Renderer;
import android.opengl.GLU;

public class HelloOpenGLES10Renderer implements Renderer {

 private Square   square;
 private Square2   square2;// the square
 private Context     context;
 private Context     context2;


 /** Constructor to set the handed over context */
 public HelloOpenGLES10Renderer(Context context) {
  this.square  = new Square();
  this.square2  = new Square2();
  this.context=context;

 }

 public void onDrawFrame(GL10 gl) {
  // clear Screen and Depth Buffer
  Square.loadGLTexture(gl, this.context,Square.getSex()); 
  Square2.loadGLTexture(gl, this.context,Square2.getHair()); 
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

    // Reset the Modelview Matrix
    gl.glLoadIdentity();

    // Drawing
    gl.glTranslatef(0.0f, 0.0f, -5.0f);  // move 5 units INTO the screen
    square.draw(gl);
    square2.draw(gl); 
 }


 public void onSurfaceChanged(GL10 gl, int width, int height) {
  if(height == 0) {       //Prevent A Divide By Zero By
   height = 1;       //Making Height Equal One
  }

  gl.glViewport(0, 0, width, height);  //Reset The Current Viewport
  gl.glMatrixMode(GL10.GL_PROJECTION);  //Select The Projection Matrix
  gl.glLoadIdentity();      //Reset The Projection Matrix

  //Calculate The Aspect Ratio Of The Window
  GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 100.0f);

  gl.glMatrixMode(GL10.GL_MODELVIEW);  //Select The Modelview Matrix
  gl.glLoadIdentity();      //Reset The Modelview Matrix
 }


 public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    // Load the texture for the square

    Square.loadGLTexture(gl, this.context,Square.getSex());


    gl.glEnable(GL10.GL_TEXTURE_2D); 
    gl.glDisable(GL10.GL_DEPTH_TEST);
    gl.glEnable(GL10.GL_BLEND);

    gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);

    gl.glShadeModel(GL10.GL_SMOOTH);    //Enable Smooth Shading
    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);  //Black Background
    gl.glClearDepthf(1.0f);      //Depth Buffer Setup
    gl.glDepthFunc(GL10.GL_NEVER);    //The Type Of Depth Testing To Do

    //Really Nice Perspective Calculations
    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
   }
}

And the application looks like this:
Imgur

As you can see the texture with the hair is transparent.
Any suggestions on what i could do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:58:01+00:00Added an answer on June 6, 2026 at 1:58 pm

    Somehow this worked for me:

     gl.glEnable(GL10.GL_BLEND); 
     gl.glEnable(GL10.GL_TEXTURE_2D); 
     gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); 
     gl.glShadeModel(GL10.GL_FLAT); 
     gl.glColor4f(1.0f, 1.0f, 1.0f, 2.0f);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: package com.powergroupbd.timer; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.CountDownTimer;
This is my MyTasteActivity code: package MyTaste; import android.app.Activity; import android.content.Context; import android.os.Bundle; import
Consider this code: package Prova; import java.util.ArrayList; public class Prova { private ArrayList<String> people;
This piece of code is from Adobe docs : package { import flash.display.Loader; import
To be specific, I was trying this code: package hello; public class Hello {
I didn't understand ..why I am facing this error.. Here is my code: package
I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc --
We have some code kicking around that uses this old internal Sun package for
I have an Android Project called Hello on my Ubuntu 10.04 i386 Server (headless).
This is my code package alpha ; class A1 { static class A11 {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.