잡담2011. 9. 30. 17:45
지금은 mobile OS 에서 Windows Phone이 허덕이고 있긴하지만, 언젠가 화려한 부활을 기대하고 있는 사람으로써(실제로 특허 공세등의 약간은 치사한 방법-그러나 합법적인 권리 행사-도 동원하고 있긴 하지만, Windows Phone Mango 버전에서는 호평을 듣고 있는 듯), 평소 Microsoft Product 및 개발에 관심이 많다. 이러한 사연으로 얼마 전까지 MSDN Magazine을 구독 했었는데, 위치적인 제약 때문에 불편한 점이 많았다. 발행이 되고나면 항공우편으로 배송이 되는데 상당한 기간이 걸리고, 웬만한 내용들은 온라인으로 볼 수가 있기 때문에 큰 잇점이 없었다. 이런 저런 이유로 결국 구독을 중지 했었다.

그런데, 얼마전 아래와 같은 메일이 왔다. MSDN의 digital 버전이 나왔으니 다시 구독하라는 내용이다.
제목만 보고서, '와~ 대단하다. 역시 통큰 MS!'라고 생각 했으니, 내가 제목에서 기대했던 것은 NYT 같은 잘 만들어진 iPad App. 이었던 것이다.

그러나 내용을 자세히 읽어보니, 아무래도 PDF 버전인 것 같다. IT/개발 관련 잡지에서 그렇게 다이나믹 한 컨텐츠들이 그리 많을 것 같진 않지만, 그래도 app. 형식이었다면 얼마나 좋았을까라는 아쉬움이 남는다.

실제로는? 당분간은 재 구독은 하지 않으려고 한다. : )

As a former MSDN Magazine subscriber, you know it's your best resource for insights into new Microsoft applications, beta testing results, tech reviews, and coding tips for your projects. However, your subscription has lapsed - and we want you back! 

Our international readers often tell us their biggest reason for not renewing their subscription is slow delivery of or local postal damage to their printed magazine. But you can avoid that frustration with MSDN Magazine's digital edition! 

Receive your magazine within days of publication, rather than weeks, and in full format, so you don't miss a single article or column by our Microsoft experts. The MSDN Magazine digital edition is the best option for our readers outside the U.S., especially in challenging delivery areas. No more missing pages, torn covers, or late issues!

Click here to start your digital subscription now! 

MSDN Magazine's digital edition is only US$25.00 for one year - it's your most convenient and inexpensive way to get all the latest developments in Microsoft programs and tools, including Visual Studio, Silverlight, ASP.NET, SQL, SharePoint, Agile C++, Windows and more. Don't miss any more information! 

Subscribe Now to get started with our next issue! 

Fast delivery and big savings - plus complete Microsoft developer data. Digital MSDN Magazine just makes sense. Welcome back! 

Sincerely, 
The Editors of MSDN Magazine


Posted by 세월의돌
3D그래픽2011. 9. 29. 11:41
GLSurfaceView.Renderer interface에는 아래와 같이 세 개의 abstract method가 정의되어 있다.

Public Methods
abstract void onDrawFrame(GL10 gl)
Called to draw the current frame.
abstract void onSurfaceChanged(GL10 gl, int width, int height)
Called when the surface changed size.
abstract void onSurfaceCreated(GL10 gl, EGLConfig config)
Called when the surface is created or recreated.

이름에서 알 수 있듯이, GLSurfaceView.Renderer가 생성될 때 호출되는 순서는 다음과 같고,

onSurfaceCreated() → onSurfaceChanged() → onDrawFrame()


일단 GLSurfaceView.Renderer가 생성되고 나면, surface의 크기가 변경되지 않는 한 onDrawFrame이 반복 호출된다.

그런데, GLSurfaceView에 있는 onPause()가 호출 되면 GLSurfaceView.Renderer interface의 abstract method 들의 호출이 중단되고, onResume()이 호출되면, onSurfaceCreated()부터 다시 호출이 된다. 즉, surface가 다시 생성된다.

Public Methods
void onPause()
Inform the view that the activity is paused.
void onResume()
Inform the view that the activity is resumed.

이렇게 되면, 새로 생성하는 texture나 shader의 index(?)가 모두 0에서부터 다시 시작되는 것으로 보아, 기존에 생성 해 두었던 texture나 shader program 등의 object들이 모두 제거되는 것으로 보인다. 
그러므로, 뭔가 초기화를 하고 싶다면, onPause() / onResume()을 명시적으로 호출하고, onSurfaceCreated()에 필요한 초기화 코드를 추가하면 될 것 같다.

Posted by 세월의돌