기본

OpenGLES 초보 2014. 7. 4. 15:48

* 보고 있는 책

OpenGL ES 2.0 프로그래밍 가이드

홍릉과학출판사




OpenGL로 배우는 컴퓨터 그래픽스

한빛미디어




쉐이더는 그래픽 하드웨어(GPU) 상에서 동작하는 간단한 프로그램으로 입력 데이터를 스크린상의 이미지로 변환한다.

쉐이더 프로그램은 OpenGL Shader 언어(GLSL)로 작성되는데 C 언어와 유사하다.

이 기능을 완벽하게 활용하기 위해서는 GLSL에 대해서 배워야 한다

------------------------------------------------------------------------------

EGL: Native platform graphics interface 로서 OpenGL 과 같은 Khronos graphics API 들과

        Native platform window system 과의 interface 역할.

        EAGL 은 Apple 의 EGL.

------------------------------------------------------------------------------



UIView 상속


#import <QuartzCore/QuartzCore.h>

#import <OpenGLES/ES2/gl.h>

#import <OpenGLES/ES2/glext.h>


+ (Class)layerClass

{

  return [CAEAGLLayer class];

}



- (id)initWithFrame:(CGRect)frame

{

  self = [super initWithFrame:frame];

  if (self == nil) return self;

  

  NSDictionary* dic = [NSDictionary dictionaryWithObjectsAndKeys:

                       [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking,

                       kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,

                       nil];

  CAEAGLLayer* eaglLayer = (CAEAGLLayer*)self.layer;

  eaglLayer.opaque = YES;

  eaglLayer.drawableProperties = dic;

  return self;

}

반응형

'OpenGLES 초보' 카테고리의 다른 글

opengles 에서 gluPerspective 함수 구현  (0) 2014.07.04
어파인 공간 (Affine Space)  (0) 2014.07.04
3차원 물체의 표현  (0) 2014.07.04
Program(프로그램) 객체  (0) 2014.07.04
쉐이더(Shader) 객체  (0) 2014.07.04
Posted by 돌비
,