오픈지엘 es 질문 좀 드립니다.

lalupo20의 이미지

안드로이드 상에서 c++로 오픈지엘 이용해서 게임을 만들고 있는데요.

일단 구조를 간단히 설명드리면

화면에 그려지는 객체들은 두가지 색상값을 갖습니다.

하나는 실제로 표현될 색상이고

두번째는 터치를 위한 색상입니다.

두번째 색상값은 RGB에서 r값을 0, 5, 10, 15... 이런식으로 순서대로 입히고

터치가 들어오면 해당 부분의 색상값을 읽고 비교해서 어떤 객체가 터치 되었는지 판독하는 형식입니다.

static void engine_draw_frame(struct engine* engine) {
		if (engine->display == NULL) {
			// 디스플레이가 없습니다.
			return;
		}
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
		renderModule->setupViewPort(engine->width, engine->height);
 
		renderModule->render();
		if (screenTouched) {
 
			renderModule->setFakeMode(true);
			renderModule->render();
 
			int x = engine->state.x[pointerIndex];
			int y = screenManager->scrHeight - engine->state.y[pointerIndex];
 
			glReadPixels(x, y,
				1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
 
			renderModule->setFakeMode(false);
			renderModule->render();
			screenTouched = false;
		}
 
 
		eglSwapBuffers(engine->display, engine->surface);
	}

터치를 처리하는 부분은 위 소스와 같고

1. 터치가 들어오면 객체들에 터치를 위한 색상을 입혀줌
2. 색상값을 읽고
3. 다시 화면에 표시할 색상을 입혀줌

이런 구조 입니다.

근데 제가 현재 겪고 있는 문제가

화면을 터치하면 텍스쳐 입혀놓은 객체가 깜빡거리는 현상이 있습니다.

위에 작성한 코드에서 터치를 위한 색상을 입혀주는 부분때문에 깜빡거리면

모든 객체가 깜빡거려야 하는거 같은데 현재 텍스처를 입혀둔 객체들만 깜빡 거립니다.

그래서 위 소스때문에 그런 현상이 발생하는것은 아닌거 같습니다.

void RenderModule::rendererSetting() {
 
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
 	glEnable(GL_DEPTH_TEST);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glDepthFunc(GL_LEQUAL);
	glDepthMask(GL_TRUE);	
}

오픈지엘 셋팅?하는 부분은 위와 같은데

여기서 glEnable(GL_DEPTH_TEST)를 꺼주면 깜빡거리는 증상은 사라지는데

큐브같은 입체 도형이 제대로 그려지지 않습니다.

현재 문제가 발생하는 동영상을 유튜브에 올려두었습니다.

https://youtu.be/8acbL6J-8VU

무엇이 문제인지 조언 좀 부탁드리겠습니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.