aboutsummaryrefslogtreecommitdiff
path: root/cvs/cvsweb.cgi/code/client/Attic/client.cpp?rev=1.2&content-type=text/x-cvsweb-markup&hideattic=0&sortby=date/index.html
blob: d6862e6785ec6b31d9c4fad13b67c56839f80f25 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD><style>		A { color:black }</style>
<!-- hennerik CVSweb $Revision: 1.93 $ -->
<TITLE>code/client/client.cpp - view - 1.2</TITLE></HEAD>
<BODY BGCOLOR="#eeeeee">
<table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="#aaaaaa"><tr valign=bottom><td><a href="client.cpp?hideattic=0&amp;sortby=date"><IMG SRC="/inc/img/picto-up.gif" ALT="[BACK]" BORDER="0" WIDTH="14" HEIGHT="13"></a> <b>Return to <A HREF="client.cpp?hideattic=0&amp;sortby=date">client.cpp</A>
 CVS log</b> <IMG SRC="/inc/img/picto-news.gif" ALT="[TXT]" BORDER="0" WIDTH="13" HEIGHT="15"></td><td align=right><IMG SRC="/inc/img/picto-dir.gif" ALT="[DIR]" BORDER="0" WIDTH="15" HEIGHT="13"> <b>Up to  <a href="/cvs/cvsweb.cgi/?hideattic=0&amp;sortby=date">Nevrax</a> / <a href="/cvs/cvsweb.cgi/code/?hideattic=0&amp;sortby=date">code</a> / <a href="/cvs/cvsweb.cgi/code/client/?hideattic=0&amp;sortby=date">client</a></b></td></tr></table><HR noshade><table width="100%"><tr><td bgcolor="#ffffff">File:  <a href="/cvs/cvsweb.cgi/?hideattic=0&amp;sortby=date">Nevrax</a> / <a href="/cvs/cvsweb.cgi/code/?hideattic=0&amp;sortby=date">code</a> / <a href="/cvs/cvsweb.cgi/code/client/?hideattic=0&amp;sortby=date">client</a> / <a href="/cvs/cvsweb.cgi/code/client/Attic/?hideattic=0&amp;sortby=date">Attic</a> / <a href="/cvs/cvsweb.cgi/code/client/Attic/client.cpp?hideattic=0&amp;sortby=date">client.cpp</a>&nbsp;(<A HREF="/cvs/cvsweb.cgi/~checkout~/code/client/Attic/client.cpp?rev=1.2&amp;hideattic=0&amp;sortby=date" target="cvs_checkout" onClick="window.open('/cvs/cvsweb.cgi/~checkout~/code/client/Attic/client.cpp?rev=1.2','cvs_checkout','resizeable,scrollbars');"><b>download</b></A>)<BR>
Revision <B>1.2</B>, <i>Wed Nov 22 15:54:42 2000 UTC</i> (20 months ago) by <i>coutelas</i>
<BR>Branch: <b>MAIN</b>
<BR>Changes since <b>1.1: +61 -6
 lines</b><PRE>
added interface for shard choice
</PRE>
</td></tr></table><HR noshade><PRE>
#include &lt;windows.h&gt;
#include &lt;gl/gl.h&gt;


#include &lt;string&gt;
#include &quot;nel/3d/driver.h&quot;
#include &quot;nel/misc/types_nl.h&quot;
#include &quot;login_interface.h&quot;
#include &quot;shards_list_interface.h&quot;


CLogUserId login(NL3D::CScene * scene, uint w, uint h)
{
 &nbsp; &nbsp; &nbsp; &nbsp;CLoginInterface logscreen;
 &nbsp; &nbsp; &nbsp; &nbsp;logscreen.init(scene, w, h);
 &nbsp; &nbsp; &nbsp; &nbsp;return logscreen.log();
}

uint chooseShard(NL3D::CScene * scene, uint w, uint h, 
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const std::vector&lt;ucstring&gt;&amp; shards)
{
 &nbsp; &nbsp; &nbsp; &nbsp;CShardsListInterface shardListScreen;
 &nbsp; &nbsp; &nbsp; &nbsp;shardListScreen.init(scene, w, h, shards);
 &nbsp; &nbsp; &nbsp; &nbsp;return shardListScreen.choose();
}



std::vector&lt;ucstring&gt; connect(CLogUserId id) //TEMP !!
{
 &nbsp; &nbsp; &nbsp; &nbsp;std::vector&lt;ucstring&gt; shards;
 &nbsp; &nbsp; &nbsp; &nbsp;shards.reserve(10);
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucs;
 &nbsp; &nbsp; &nbsp; &nbsp;ucs+='s';ucs+='h';ucs+='a';ucs+='r';ucs+='d';ucs+=' ';
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucsa = ucs; ucsa += 'A';
 &nbsp; &nbsp; &nbsp; &nbsp;shards.push_back(ucsa);
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucsb = ucs; ucsb += 'B';
 &nbsp; &nbsp; &nbsp; &nbsp;shards.push_back(ucsb);
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucsc = ucs; ucsc += 'C';
 &nbsp; &nbsp; &nbsp; &nbsp;shards.push_back(ucsc);
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucsd = ucs; ucsd += 'D';
 &nbsp; &nbsp; &nbsp; &nbsp;shards.push_back(ucsd);
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucse = ucs; ucse += 'E';
 &nbsp; &nbsp; &nbsp; &nbsp;shards.push_back(ucse);
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucsf = ucs; ucsf += 'F';
 &nbsp; &nbsp; &nbsp; &nbsp;shards.push_back(ucsf);
 &nbsp; &nbsp; &nbsp; &nbsp;ucstring ucsg = ucs; ucsg += 'G';
 &nbsp; &nbsp; &nbsp; &nbsp;shards.push_back(ucsg);
 &nbsp; &nbsp; &nbsp; &nbsp;return shards;
}





/****************************************************************\
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MAIN
\****************************************************************/
void main()
{
 &nbsp; &nbsp; &nbsp; &nbsp;// init scene
 &nbsp; &nbsp; &nbsp; &nbsp;uint w = 800;
 &nbsp; &nbsp; &nbsp; &nbsp;uint h = 600;
 &nbsp; &nbsp; &nbsp; &nbsp;uint bpp = 32;
 &nbsp; &nbsp; &nbsp; &nbsp;bool windowed = true;
 &nbsp; &nbsp; &nbsp; &nbsp;NL3D::CScene scene;
 &nbsp; &nbsp; &nbsp; &nbsp;NL3D::CSceneUt::init3d(scene, w, h, bpp, windowed); 
 &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp;// user login session
 &nbsp; &nbsp; &nbsp; &nbsp;CLogUserId id = login(&amp;scene, w, h);
 &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp;// connection // TEMP !!
 &nbsp; &nbsp; &nbsp; &nbsp;std::vector&lt;ucstring&gt; shards = connect(id);

 &nbsp; &nbsp; &nbsp; &nbsp;// shard choice
 &nbsp; &nbsp; &nbsp; &nbsp;uint shardIndex = chooseShard(&amp;scene, w, h, shards);

 &nbsp; &nbsp; &nbsp; &nbsp;// release scene
 &nbsp; &nbsp; &nbsp; &nbsp;NL3D::CSceneUt::release3d(scene);
}</PRE>