SpriteBatchNode란? 하나의 sprite를 여러번 그릴 때 유용하다 (tile맵)draw call을 줄여서 성능을 향상 시킨다여러 개의 sprite를 한번에 이동 가능 // 15.06.14 추가// 실시간으로 sprite를 만들어서 거기다가 sprite데이터들을 저장하고, 그렇게 생성된 하나의 sprite를 그리는 듯 구현 // CCLayer > CCSpriteBatchNode > CCSprite 순으로 구현 CCSpriteBatchNode *batch = CCSpriteBatchNode::create("file.png");this->addchild(batch); // 1CCSprite *spr1 = CCSprite::create("file.png"/*, CCRect(0,0,100,100)*/..
// normal readFILE *f = fopen("file.bmp", "rb");unsigned char info[54];fread(info, sizeof(unsigned char), 54, f); int width = *(int*)&info[18];int height = *(int*)&info[22]; int size = 3*width*height; // for RGBunsigned char *data = new unsigned char[size];fread(data, sizeof(unsigned char), size, f);fclose(f); // bmp를 저장할 때 RGB가 아닌 BGR순으로 저장하기 때문for(int i=0; i int width = *(int*)&info[18];int he..
맴버 이니셜라이저란?- 생성자가 실행되기 전에 먼저 실행되는 명령class A{private:int a;int b;public:A():a(10){ // 생성과 동시에 초기화b = 20; // 생성이 된 후 초기대입}}; 기능 1. const 맴버변수 & 레퍼런스 변수 초기화class B{private:int a;const int b;int& c;public:B():a(10), b(20), c(a){ // 초기화}}; 2. 부모 클래스의 생성자 호출- 상속 관계인 클래스의 생성 순서는 부모->자식 순서로 되야한다class A{public:A(int a){}};class B : public A{public:B():A(5){ // B의 생성자가 실행되기 전에 A의 생성자 호출}};
- Total
- Today
- Yesterday
- scala
- Git
- 알고리즘
- SHADER
- DesignPattern
- 자료구조
- rxswift
- Cocos2d-x
- winsock
- machine learing
- 국내여행
- Spring
- game
- JSP
- 드라마
- 운영체제
- ios
- 수학
- database
- Java
- OS
- swift
- ue4
- C++
- C/C++
- mongoDB
- 데이터베이스
- SOCKET
- C
- SwiftUI
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |