• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ InitData函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中InitData函数的典型用法代码示例。如果您正苦于以下问题:C++ InitData函数的具体用法?C++ InitData怎么用?C++ InitData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了InitData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: InitData

/*!
	@param _radarVolumeData 地面に投影する予定の雲のボリュームテクスチャ を渡す。floatでRGBAで既に虹色に変換されたデータにすること
	@param _size ボリュームデータのサイズ
*/
void CLand::Init(color<float>* _radarVolumeData,int _size){
	m_List[0]=glGenLists(2);
	//glGenBuffers(2, m_IdBufferId);
	//glGenBuffers(2, m_BufferId);
	InitData("../data/map/iruma.jmesh",0);
	InitData("../data/map/komaki.jmesh",1);
	
	
	glActiveTexture(GL_TEXTURE1);

	glGenTextures ( 1, &m_ProjectedSamp[0] );
	glBindTexture (GL_TEXTURE_2D, m_ProjectedSamp[0]);
	glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGBA, _size, _size, 0, GL_RGBA, GL_FLOAT, _radarVolumeData);
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
	glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
	glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
	
   glActiveTexture(GL_TEXTURE1);
   glGenTextures ( 1, &m_ProjectedSamp[1] );
   glBindTexture (GL_TEXTURE_2D, m_ProjectedSamp[1]);
   glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGBA, _size, _size, 0, GL_RGBA, GL_FLOAT, _radarVolumeData);
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
   glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
   glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
   glActiveTexture(GL_TEXTURE0);
 
   cout<<"地図バッファ情報"<<endl;
   mProgram=new CGLSLClipProjected("land.vert","land.frag");
   mProgram->UpdateTextureUniform();
}
开发者ID:miffysora,项目名称:CloudRender-PointSplatting,代码行数:38,代码来源:Land.cpp


示例2: InitData

int Application::Execute()
{
    if (!LoadData(trainingImgs, Utils::TRAINING_IMAGES_PER_SUBJECT, true))
        return Utils::EXIT_F;
    if (!LoadData(validationImgs, Utils::VALIDATION_IMAGES_PER_SUBJECT, false))
        return Utils::EXIT_F;

    InitData(&trainingInputs, &trainingLabels, Utils::TRAINING_TOTAL_INPUT, trainingImgs);
    InitData(&validationInputs, &validationLabels, Utils::VALIDATION_TOTAL_INPUT, validationImgs);

    int hiddenLayerNeurons[] = { 5 };
    NeuralNetwork ann(Utils::PIXEL_COUNT, Utils::HIDDEN_LAYER_COUNT, hiddenLayerNeurons, Utils::SUBJECT_COUNT);

    printf(Utils::BEGIN_TRAINING);
    ann.Train(trainingInputs, trainingLabels, Utils::TRAINING_TOTAL_INPUT);
    printf(Utils::END_TRAINING);

    ann.Save("ocr.ann");

    for (int x = 0; x < Utils::VALIDATION_TOTAL_INPUT; x++)
    {
        for (int y = 0; y < Utils::SUBJECT_COUNT; y++)
            validationLabels[x][y] = ann.GetGuess(validationInputs[x], y);
    }

    for (int x = 0; x < Utils::VALIDATION_TOTAL_INPUT; x++)
    {
        for (int y = 0; y < Utils::SUBJECT_COUNT; y++)
            std::printf("%5.5f\n", validationLabels[x][y]);
        std::printf("\n");
    }

    Clean();
    return Utils::EXIT_S;
}
开发者ID:jbowren,项目名称:SimpleMLP,代码行数:35,代码来源:Application.cpp


示例3: defined

void Data::LoadData()
{
#if defined(_WIN32) || defined(_WIN64)
	_finddata_t fd;
	long handle;
	int result = 1;

	handle = _findfirst("용사.txt", &fd);
	if (handle == -1)
	{
		InitData();
		return;
	}
#elif defined(__linux__)
	dirent **namelist;
	int n;

	n = scandir(".", &namelist, 0, alphasort);

	if (n < 0)
	{
		InitData();
		return;
	}

	int i;
	for (i = 0; i < n; i++)
	{
		if (strcmp(namelist[i]->d_name, "용사.txt") == 0)
		{
			free(namelist[n]);
			break;
		}
		free(namelist[n]);
	}
	free(namelist);

	if (i == n)
	{
		InitData();
		return;
	}
#endif

	char buffer[65536];
	FILE *file = fopen("용사.txt", "r");

	rapidjson::FileReadStream is(file, buffer, sizeof(buffer));
	document.ParseStream(is);
	fclose(file);
}
开发者ID:Nickchooshin,项目名称:Project_HK,代码行数:51,代码来源:Data.cpp


示例4: InitData

BOOL TransientSet::IsDefine()
{
	InitData();
	if(ms_TotalSteps.GetnValue()<=0)
		return FALSE;
	return TRUE;
}
开发者ID:uesoft,项目名称:AutoPFA,代码行数:7,代码来源:TransientSet.cpp


示例5: m_size

SmallImage::SmallImage(unsigned int width, unsigned int height, unsigned int iComponentCount) :
 m_size(width, height),
 m_iComponentCount(iComponentCount),
 m_pData(0)
{
  InitData();
}
开发者ID:RockLobster,项目名称:ImageVis3D,代码行数:7,代码来源:SmallImage.cpp


示例6: BArchivable

BShape::BShape(BMessage* archive)
	:	BArchivable(archive)
{
	InitData();

	shape_data* data = (shape_data*)fPrivateData;

	ssize_t size = 0;
	int32 count = 0;
	type_code type = 0;
	archive->GetInfo("ops", &type, &count);
	if (!AllocateOps(count))
		return;

	int32 i = 0;
	const uint32* opPtr;
	while (archive->FindData("ops", B_INT32_TYPE, i++, (const void**)&opPtr, &size) == B_OK)
		data->opList[data->opCount++] = *opPtr;

	archive->GetInfo("pts", &type, &count);
	if (!AllocatePts(count)) {
		Clear();
		return;
	}

	i = 0;
	const BPoint* ptPtr;
	while (archive->FindData("pts", B_POINT_TYPE, i++, (const void**)&ptPtr, &size) == B_OK)
		data->ptList[data->ptCount++] = *ptPtr;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:30,代码来源:Shape.cpp


示例7: message

/*!	\brief Creates and initializes a new BMessageRunner.

	This constructor version additionally allows to specify the target for
	replies to the delivered message(s).

	The success of the initialization can (and should) be asked for via
	InitCheck().

	\note As soon as the last message has been sent, the message runner
		  becomes unusable. InitCheck() will still return \c B_OK, but
		  SetInterval(), SetCount() and GetInfo() will fail.

	\param target Target of the message(s).
	\param message The message to be sent to the target.
	\param interval Period of time before the first message is sent and
		   between messages (if more than one shall be sent) in microseconds.
	\param count Specifies how many times the message shall be sent.
		   A value less than \c 0 for an unlimited number of repetitions.
	\param replyTo Target replies to the delivered message(s) shall be sent to.
*/
BMessageRunner::BMessageRunner(BMessenger target, const BMessage *message,
							   bigtime_t interval, int32 count,
							   BMessenger replyTo)
	: fToken(-1)
{
	InitData(target, message, interval, count, replyTo);
}
开发者ID:BackupTheBerlios,项目名称:nemo,代码行数:27,代码来源:MessageRunner.cpp


示例8: PhysicsBody2D

//=================================================================================================================
//=================================================================================================================
TopdownTile::TopdownTile()
:	PhysicsBody2D()
,	m_D3DSystem(0)
,	m_engineOptions(0)
{
	InitData();
}
开发者ID:henriyl,项目名称:ZShadeSandbox,代码行数:9,代码来源:TopdownTile.cpp


示例9: InitData

MP3File::MP3File(video::iStreamPort* pport)
{
  InitData();
  m_pPort = pport;
  m_bStreaming = true;
  m_pMP3FilePtr = OSCL_FileOpen(m_pPort);
  if(m_pPort)
  {
    int64 noffset = 0;
    uint64 size = MAX_FILE_SIZE;
    video::iStreamPort::DataSourceType eSourceType =
      video::iStreamPort::DS_FILE_SOURCE;
    if(video::iStreamPort::DS_SUCCESS == m_pPort->GetContentLength(&noffset))
    {
      size = (uint64)noffset;
    }
    m_pPort->GetSourceType(&eSourceType);
    if (video::iStreamPort::DS_STREAMING_SOURCE != eSourceType)
    {
      m_bStreaming = false;
    }
    m_nFileSize = size;
  }
  if(ParseMP3Header()== PARSER_ErrorNone )
  {
    _fileErrorCode = PARSER_ErrorNone;
    _success = true;
  }
}
开发者ID:xingrz,项目名称:android_tools_leeco_msm8996,代码行数:29,代码来源:mp3file.cpp


示例10: emulator

void emulator() {
	/* omit business about ModuleSP, as the compiler handles such
		things for us */

	InitData();
	RecognizeCart();
	SetupBanks();
	Reset();
	Init_Service();
	Controls();

	/* ExitEmulator gets set by Controls() if the user presses
		Escape */
	while( !ExitEmulator ) {
		VSync();
		srv_CopyScreen();
		ScanFrame();
		Controls();

		while(GamePaused) {
			Controls();
		}
	}

}
开发者ID:cinnamoncoin,项目名称:z26,代码行数:25,代码来源:c_core.c


示例11: main

int main (int argc, char * argv[]) {
    world = new World("Dclock", argc, argv);
    DoArgs(argc, argv);
    InitData();
    switch (CreateMode) {
	case SWEPT:
	    TheClock = new DFace(
		ShowDate, ShowBorder, ShowTime, TimeMode
	    );
	    world->InsertApplication(TheClock);
	    break;
	case PLACED:
	    TheClock = new DFace(
		ShowDate, ShowBorder, ShowTime, TimeMode, Width, Height
	    );
	    world->InsertApplication(TheClock);
	    break;
	case DEFINED:
	    TheClock = new DFace(
		ShowDate, ShowBorder, ShowTime, TimeMode, Width, Height
	    );
	    world->InsertApplication(TheClock, XPos, YPos);
	    break;
    }
    TheClock->Run();
    return 0;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:27,代码来源:dclock.c


示例12: BControl

BTextControl::BTextControl(BMessage *data)
	:	BControl(data)
{
	InitData(Label(), NULL, data);

	int32 _a_label = B_ALIGN_LEFT;
	int32 _a_text = B_ALIGN_LEFT;

	if (data->HasInt32("_a_label"))
		data->FindInt32("_a_label", &_a_label);

	if (data->HasInt32("_a_text"))
		data->FindInt32("_a_text", &_a_text);
	
	SetAlignment((alignment)_a_label, (alignment)_a_text);

	if (data->HasFloat("_divide"))
		data->FindFloat("_a_text", &fDivider);

	if (data->HasMessage("_mod_msg")) {
		BMessage *_mod_msg = new BMessage;
		data->FindMessage("_mod_msg", _mod_msg);
		SetModificationMessage(_mod_msg);
	}
}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:25,代码来源:TextControl.cpp


示例13: ASSERT

void CTRL::ChangeStyle(BODY_TYPE newStyle)
//改变控件类型
{
	ASSERT(newStyle != style);
	free(data);			//释放原来类型对应的数据空间
	InitData(newStyle);	//初始化控件数据部分
}
开发者ID:wm3418925,项目名称:Steady-circuit,代码行数:7,代码来源:Ctrl.cpp


示例14: InitData

void MainWindow::Resetbro(long num){
    //QStringList bro_text;
    QString tmp_data = "";
    pstustr bro_ptemp;
    bro_ptemp = head;
    ui->textBrowser->clear();
    if(!head)
    {

        QMessageBox::warning(this,tr("警告"),tr("哈哈,没人了"),QMessageBox::Yes);
        InitData();
        Resetbro();
    }
    else
    {
        while(NULL!=bro_ptemp)
        {
            if(bro_ptemp->stunum==num)
            {
                tmp_data = "  "+QString::number(bro_ptemp->id,10) + "    姓名:" + QString(bro_ptemp->name) + "   学号:"
                        + QString::number(bro_ptemp->stunum,10) + "   专业:" + QString(bro_ptemp->major)
                        + "   学科:" + QString(bro_ptemp->psubinfo.subname) + "   分数:"
                        + QString::number(bro_ptemp->psubinfo.marks,10);

                ui->textBrowser->append(tmp_data);
            }
            bro_ptemp = bro_ptemp->pnext;

        }
    }
    // ui->textBrowser->append(tmp_data);
}
开发者ID:kangqf,项目名称:Mysql_stuinfo,代码行数:32,代码来源:mainwindow.cpp


示例15: InitView

BOOL CPanelDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	InitView();
	InitData();
	return TRUE;
}
开发者ID:c4bbage,项目名称:trochilus,代码行数:7,代码来源:PanelDlg.cpp


示例16: main

int main()    
{	
	InitData();	 					
	
	while(1) {

		ReadTimeAndJudgeAlarmArrival();

		switch (mainLoop) {
		case 0:
			display_time();
			break;
		case 1:
			display_data();
			break;
		case 2:
			display_alarm();
			break;
		case 3:
			display_sWatch();
			break;
		}
		KeyScan();
	}

	return 0;
}
开发者ID:ZhengzhenZhang,项目名称:course-design,代码行数:27,代码来源:eClock.c


示例17: LoadData

E_AFV::E_AFV(enginetypename t)
{
	shapeType=S_Circle;
	LoadData(t);
	InitData();
	Init_GameEntity();
}
开发者ID:MechEmpire,项目名称:BattleCore,代码行数:7,代码来源:E_AFV.cpp


示例18: MP3File

MP3File:: MP3File(const FILESOURCE_STRING &filename,
                  unsigned char *pFileBuf,
                  uint64 bufSize)
{
  InitData();
  if (pFileBuf && bufSize)
  {
    m_pFileBuf = pFileBuf;
    m_nFileBufSize = bufSize;
    m_pMP3FilePtr = OSCL_FileOpen (pFileBuf, bufSize);
  }
  else
  {
    m_hFileName = filename;
#ifdef FEATURE_FILESOURCE_FILE_IO_CACHING
     /* Calling with 10K cache  buffer size */
     m_pMP3FilePtr = OSCL_FileOpen(filename, (OSCL_TCHAR *) _T("rb"), MP3_FILE_READ_BUFFER_SIZE);
#else
     m_pMP3FilePtr = OSCL_FileOpen(filename, (OSCL_TCHAR *) _T("rb"));
#endif
     m_nFileSize = OSCL_FileSize( m_hFileName );
  }
  if(ParseMP3Header() == PARSER_ErrorNone)
  {
    _fileErrorCode = PARSER_ErrorNone;
    _success = true;
  }
}
开发者ID:xingrz,项目名称:android_tools_leeco_msm8996,代码行数:28,代码来源:mp3file.cpp


示例19: PLAY_EFFECT

void CMatchGame::UpdateGameState()
{
	//检查是否匹配
	int iBoomIndex = 0;
	for (int i = 0; i < BRICK_MATCH_NUM; ++i)
	{
		if (m_arrMyBrick[i] != m_arrDestBrick[i])
		{
			m_enGameState = GAMESTATE_OVER;
			PLAY_EFFECT(EFFECT_BOOM);
			m_arrBoomIndex[iBoomIndex++] = i;
		}
	}

	//如果都匹配,则加分,检查是否通过当前等级
	if (iBoomIndex == 0)
	{
		m_iScore += MACTHSUCC_ADDSCORE;
		m_pGameScene->UpdateScore(m_iScore);

		if (++m_iMatchSuccCount >= GAMEPASS_MATCHCOUNT)
		{
			m_enGameState = GAMESTATE_PASS;
		}
		else
		{
			//重新产生目标方块和我方方块
			InitData();
		}
	}
}
开发者ID:lfeng1420,项目名称:BrickGame,代码行数:31,代码来源:MatchGame.cpp


示例20: InitData

bool BattleEntity::init()
{	
	m_vecAnimation.resize(ES_MAX);
	m_vecAnimation[ES_IDLE] = "Idle";
	m_vecAnimation[ES_IDLE2] = "Idle";
	m_vecAnimation[ES_RUN] = "Move";
	m_vecAnimation[ES_WIN] = "Cheer";
	m_vecAnimation[ES_FALIURE] = "failure";
	m_vecAnimation[ES_ATTACK1] = "atk";
	m_vecAnimation[ES_ATTACK2] = "atk";
	m_vecAnimation[ES_SKILL1] = "atk2";
	m_vecAnimation[ES_SKILL2] = "atk2";
	m_vecAnimation[ES_HURT] = "Damaged";
	m_vecAnimation[ES_DEAD] = "Death";

    InitData();
    m_pAnimationNode = CreateAnimation();
    addChild(m_pAnimationNode);
	m_pAnimationNode->setPosition(getAnchorPointInPoints());
	
	OnAnimationCreate(m_pAnimationNode);

    scheduleUpdate();
    return true;
}
开发者ID:bluesky7290,项目名称:NoahGameFrame,代码行数:25,代码来源:BattleEntity.cpp



注:本文中的InitData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ InitDevice函数代码示例发布时间:2022-05-30
下一篇:
C++ InitD3D函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap