ページ 11

トグルについて

Posted: 2017年1月17日(火) 00:14
by judmof
c++でトグルを用いて画像を表示・消去をやりたいのですが、使い方がわからないので教えてください・。

Re: トグルについて

Posted: 2017年1月17日(火) 00:19
by judmof
コード載せ忘れました

コード:

#include	"iextreme.h"
#include	"system/system.h"

#include	"sceneMain.h"
//新しいinclude  
#include	 "Delete.h"	//テンプレートヘッダー


//*****************************************************************************************************************************
//
//	グローバル変数
//
//*****************************************************************************************************************************
iexView*	view;



iex2DObj* gazou;


//*****************************************************************************************************************************
//
//	初期化
//
//*****************************************************************************************************************************

bool sceneMain::Initialize()
{
	//	環境設定
	iexLight::SetFog( 1000, 60000, 0xffffff );
	iexLight::SetAmbient(0xd3d3d3);
	



	//	カメラ設定
	view = new iexView();
	view->Clear(0xffffff);
	
	
	gazou = new iex2DObj("DATA\\UI\\Menue.png");

	
	a = 0;
	
	return true;
}

sceneMain::~sceneMain()
{
	SafeDelete(gazou);
}

//*****************************************************************************************************************************
//
//		更新
//
//*****************************************************************************************************************************


void	sceneMain::Update()
{
}

//*****************************************************************************************************************************
//
//		描画関連
//
//*****************************************************************************************************************************
bool menueflg = false;

void	sceneMain::Render()
{
	//描画バッファ変更
	screen->RenderTarget();

	//	画面クリア
	view->Activate();
	view->Clear(0xffffff);

	if (KEY_Get(KEY_B) ==3)
	{

		if (menueflg == false) {

			a++;
			gazou->Render(128, 72, 1024, 500, 0, 0, 512, 256);
		}
		else {
			a = 0;
		}
	}
}

Re: トグルについて

Posted: 2017年1月17日(火) 00:21
by judmof
これの描画関連という所で処理をしたいのですが・・・

Re: トグルについて

Posted: 2017年1月17日(火) 00:30
by みけCAT
オフトピック
sceneMain::Render()関数内の「menueflg」という変数名や、プログラムの構造が
画像の表示と消す方法 • C言語交流フォーラム ~ mixC++ ~
と似ていますね。
学校かなんかで与えられたテンプレートを使っているか、どこかのサイトまたは本からパクったのでしょうか?

フォーラムルールより
3. 禁止行為について

以下の行為を禁止行為として定めます。

(中略)

[C言語何でも質問掲示板でのみ適用される事項]

名前を複数利用して質問する行為

Re: トグルについて

Posted: 2017年1月17日(火) 00:34
by judmof
学校ですね