⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 q3dwebcamtxttotal.cpp

📁 可在q3d裡接收webcam的數值
💻 CPP
字号:
// Array_Buffer.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "Q3DWebCamTxtTotal.h"

#include<stdio.h>
#include<stdlib.h>
FILE *fp;
int a = 0, donow = 0;
ChannelType channelType;
	
extern "C" __declspec( dllexport ) ChannelType* __cdecl GetType() {
	ZeroMemory(channelType.name, 80);
	StringCbCopy(channelType.name,  79, Q3DWEBCAMTXTTOTAL_NAME); 
	channelType.version			= Q3DWEBCAMTXTTOTAL_VERSION;
	channelType.guid			= Q3DWEBCAMTXTTOTAL_GUID;
	channelType.baseguid		= FLOAT_CHANNEL_GUID;
	channelType.minimumEdition 	= EDITION_LEVEL_ALL;		// All Quest3D Editions

	return &channelType;
}

Q3DWEBCAMTXTTOTALDLL_EXPORTS

Q3DWebCamTxtTotal::Q3DWebCamTxtTotal() {
	SetChannelName(Q3DWEBCAMTXTTOTAL_NAME);
	//TODO: Add construction logic here
}

Q3DWebCamTxtTotal::~Q3DWebCamTxtTotal()
{
	//TODO:: Add destruction logic here
}


// Overlodaed save channel
bool Q3DWebCamTxtTotal::SaveChannel(A3dFileSaver& saver) {
	if(!A3d_Channel::SaveChannel(saver))
		return false;
	//TODO: Add your logic to save persistent data here
	return true;
}

bool Q3DWebCamTxtTotal::LoadChannel(A3dFileLoader& loader, A3d_ChannelGroup *group) {
	if(!A3d_Channel::LoadChannel(loader, group))
		return false;
	//TODO: Add your logic to load persistent data here
	return true;
}

void Q3DWebCamTxtTotal::DoDependencyInit(A3d_List* currentDependList) {
	//Include Visual Studio 2005 runtime libraries	
	AddDLLDepend("MSVCR80.DLL", currentDependList);
	AddDLLDepend("MSVCP80.DLL", currentDependList);
	AddDLLDepend("MSVCM80.DLL", currentDependList);
	AddDLLDepend("Microsoft.VC80.CRT.manifest", currentDependList);
}

void Q3DWebCamTxtTotal::CallChannel()
{
	//TODO: Add call channel logic here
	if(donow == 0)
	{
		donow = 1;
		fp = fopen("C:\\test.txt", "r");
				fscanf(fp,"%d", &a);
		fclose(fp);
		SetFloat(a);
		//engine->DMsg(a);
		donow = 0;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -