html5-img
1 / 10

3D Engine Tools with C++/ CLR

이민웅 참고 ) ShaderX6 8.2. 3D Engine Tools with C++/ CLR. 3D Engine Tools. 엔진은 C++ 로 툴은 C# 으로 개발하고 싶을때 사용 엔진 / 툴 독립적으로 유지 관리 툴 개발시 GUI 부분의 시간 단축 약간의 노가다 작업 필요 서버와 클라이언트 같은 작업 필요. CLR. CLR(Common Language Runtime) 공통 언어 런타임 성능 향상

wylie
Télécharger la présentation

3D Engine Tools with C++/ CLR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 이민웅 참고 ) ShaderX6 8.2 3D Engine Tools with C++/CLR

  2. 3D Engine Tools • 엔진은 C++로 툴은 C#으로 개발하고 싶을때 사용 • 엔진/툴 독립적으로 유지 관리 • 툴 개발시GUI부분의 시간 단축 • 약간의 노가다 작업 필요 • 서버와 클라이언트 같은 작업 필요

  3. CLR • CLR(Common Language Runtime) 공통 언어 런타임 • 성능 향상 • CLR의 JIT 컴파일러를 통해 만들어진 코드는 unmanaged code에 비해 성능이 우수 • 개체 수명을 관리하는 가비지 수집 • CLR의 장점이라기 보다는 .NET Framework 차원에서 지원하는 장점

  4. C# • .Net Framework 사용 • Java 와 비슷함 • 툴 개발이 쉽다 • GUI 개발이 편리함 • Windows Form • WPF • Xaml방식, DirectX 랜더링, Shader도 사용가능 • C++과 연동하기 위해 CLR를 사용

  5. C++/CLR C++ CLR C# Wrapper

  6. C++과 CLR 코딩 방식 • 포인터의 사용 • C++ : test * temp = new test() • CLR : test^ temp = gcnew temp() • 주소값사용은& -> % • NULL 체크 NULL -> nullptr • 클래스 • C++ : class Test • CLR : public ref class Test

  7. String 변환 • C#은 기본적으로 Unicode만 지원 • Marshal 라이브러리를 사용하여 간단히 C++용으로 변환 • 닷넷 프레임워크 3.0부터 지원 • 3.0이전 버전에는 문제가 많았음 • C# 외부 DLL 링크도 가능 msclr::interop::marshal_contextctx; const char* ch = ctx.marshal_as<const char*> (str); public sealed class DevilAPI { private const string DEVIL_LIBRARY = "Devil.dll"; [DllImport(DEVIL_LIBRARY, CallingConvention = CallingConvention.Winapi), SuppressUnmanagedCodeSecurity] public static extern void ilInit(); }

  8. Wrapper(CLR) • C++의 데이터를 C#에서 사용하기 위해서는 C++에 사용하는 데이터 구조를 C#쪽에 새로 만듬 • 저의 경우는 CLR 부분에서는 C++ <-> C#쪽의 데이터의 변환 부분만 해줌 • 툴 기능 코드들은 CLR과 C#쪽에서 모두 처리 Engine AData Tool ADataInfo Wrapper(CLR) SetAData UpdateAData

  9. Wrapper ※ 이런식의 구조도 될 수 가 있음 참고 ) 툴과 오버 엔지니어링 그리고 벽돌 http://gamedevforever.com/23

  10. 감사합니다.

More Related