|
|
| Author |
Message |
epicdave
New User
Joined: 11 Oct 2007 Posts: 16 Location: New York
|
|
|
|
hi all,
I'm playing around with GDDM and have run into an odd problem. As far as I can tell from the pubs, I should be able to create several graphical segments using the GSSEG (n) call, then close it with the GSSCLS call. The idea being that I can manipulate a group of graphics primitives easily, and have images layered on top of one another. As far as I can tell, GSSCLS is supposed to close the current segment, thereby making the active segment = null.
From the reference guide :
| Quote: |
Causes the current segment to be closed, so that no more
primitives can be added to it. After this operation, there is no
current segment within the page. Closing a segment does
not delete the segment or affect the graphics primitives that
are displayed.
If an area is open, GSSCLS closes it as if a GSENDA call
had been issued immediately before the GSSCLS call. All
graphics attributes are reset to the values for the attributes
that were in effect at the time the corresponding segment
was created. |
That all sounds logical, but when I attempt to actually do this, I get an error at the point of attempting to create the second segment. GDDM tells me that the first segment I opened is still the primary one, it ignores the call to create the second segment, which in turn creates lots of other problems.
Here's the error:
| Quote: |
ADM0055 E GSSEG, AT X'A193DABA'
ADM0150 E GRAPHICS SEGMENT 1 IS CURRENT
*** |
and here's the section of code that is causing the problem (in C) :
| Code: |
gsseg (1);
...//draw the first primitive
gsscls;
gsseg(2);
..//draw the second primative
gsscls;
asread(&type,&val,&count);
|
I am totally confused as to why the segment isn't closing as it should. I suspect it's something minor, but I'm just not seeing it. Any help y'all can provide would be much appreciated!
-David |
|
| Back to top |
|
 |
References
|
|
 |
Pedro
Senior Member
Joined: 01 Sep 2006 Posts: 536 Location: work
|
|
|
|
| Sorry, I cannot help. But I would be interested in seeing a 'hello world' program if you get something working. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8733 Location: 221 B Baker St
|
|
|
|
Hello David,
Have you tried actually issuing a GSENDA before the first close?
Have you tried to draw the second graphic without closing the first?
Do either of these shine any kind of light? |
|
| Back to top |
|
 |
epicdave
New User
Joined: 11 Oct 2007 Posts: 16 Location: New York
|
|
|
|
hi Dick,
yes, I've tried GSENDA and attempted to draw the second segment w/o closing the first. I still get the same errors. I've also tried commenting out the first gsseg(n) line to see if the gsscls statement would issue a "no active segment" error but it didn't. As far as I can tell, it's like the gsscls statement is being ignored completely and I can't for the life of me figure out why.
Here's the code as it stands:
| Code: |
000001 #include <stdio.h>
000002 #include <string.h>
000003 #include <admucina.h>
000004 #include <admtstrc.h>
000005 #include <admucinf.h>
000006 #include <admucing.h>
000007 #include <admucins.h>
000008
000009 #pragma linkage(asread,OS)
000010 #pragma linkage(chhatt,OS)
000011 #pragma linkage(chhead,OS)
000012 #pragma linkage(gsuwin,OS)
000013 #pragma linkage(gschar,OS)
000014 #pragma linkage(gsseg,OS)
000015 #pragma linkage(gsscls,OS)
000016 #pragma linkage(gsenda,OS)
000017 #pragma linkage(gssaga,OS)
000018 #pragma linkage(gsmove,OS)
000019 #pragma linkage(gscol,OS)
000020 #pragma linkage(gsline,OS)
000021 #pragma linkage(gsview,OS)
000022 #pragma linkage(gslw,OS)
000023 #pragma linkage(gsflw,OS)
000024 #pragma linkage(gsarc,OS)
000025 #pragma linkage(fsinit,OS)
000026 #pragma linkage(fsterm,OS)
000027
000028 main ()
000029 {
000030
000031 /*SETUP THE GDDM ENVIRONMENT**********************/
000032 int i;
000033 int type;
000034 int val;
000035 int count;
000036 fsinit();
000037 gsuwin(0,100,0,100);
000038 gslw(2);
000039
000040 /*DRAW THE IBM LOGO*******************************/
000041
000042 gsseg (1);
000043
000044 /*DRAW THE I*/
000045 gscol (2);
000046 gsmove(1,90);
000047 gsline (10,90);
000048
000049 gsmove(1,88);
000050 gsline (10,88);
000051
000052 gsmove(4,86);
000053 gsline (7,86);
000054
000055 gsmove(4,84);
000056 gsline (7,84);
000057
000058 gsmove(4,82);
000059 gsline (7,82);
000060
000061 gsmove(4,80);
000062 gsline (7,80);
000063
000064 gsmove(1,78);
000065 gsline (10,78);
000066
000067 gsmove(1,76);
000068 gsline (10,76);
000069
000070 /*DRAW THE B*/
000071 gscol (4);
000072 gsmove (15,90);
000073 gsline (32,90);
000074
000075 gsmove (15,88);
000076 gsline (34,88);
000077
000078 gsmove (17,86);
000079 gsline (22,86);
000080
000081 gsmove (28,86);
000082 gsline (33,86);
000083
000084 gsmove (17,84);
000085 gsline (32,84);
000086
000087 gsmove (17,82);
000088 gsline (33,82);
000089
000090 gsmove (17,80);
000091 gsline (22,80);
000092
000093 gsmove (28,80);
000094 gsline (34,80);
000095
000096 gsmove (15,78);
000097 gsline (34,78);
000098
000099 gsmove (15,76);
000100 gsline (32,76);
000101
000102 /*DRAW THE M*/
000103 gscol (9);
000104 gsmove (40,90);
000105 gsline (47,90);
000106 gsmove (54,90);
000107 gsline (61,90);
000108
000109 gsmove (40,88);
000110 gsline (48,88);
000111 gsmove (53,88);
000112 gsline (61,88);
000113
000114 gsmove (43,86);
000115 gsline (49,86);
000116 gsmove (52,86);
000117 gsline (58,86);
000118
000119 gsmove (43,84);
000120 gsline (50,84);
000121 gsmove (51,84);
000122 gsline (58,84);
000123
000124 gsmove (43,82);
000125 gsline (46,82);
000126 gsmove (47,82);
000127 gsline (54,82);
000128 gsmove (55,82);
000129 gsline (58,82);
000130
000131 gsmove (43,80);
000132 gsline (46,80);
000133 gsmove (48,80);
000134 gsline (53,80);
000135 gsmove (55,80);
000136 gsline (58,80);
000137
000138 gsmove (40,78);
000139 gsline (46,78);
000140 gsmove (49,78);
000141 gsline (52,78);
000142 gsmove (55,78);
000143 gsline (61,78);
000144
000145 gsmove (40,76);
000146 gsline (46,76);
000147 gsmove (50,76);
000148 gsline (51,76);
000149 gsmove (55,76);
000150 gsline (61,76);
000151
000152 gsscls;
000153
000154 /*DRAW A BOX**************************************/
000155 gsseg (2);
000156 gscol (7);
000157 gsmove (0,0);
000158 gsline (0,25);
000159 gsline (25,25);
000160 gsline (25,0);
000161 gsline (0,0);
000162
000163 gsscls;
000164
000165
000166 /*TRY OUT THE GRAPHICS TEXT FUNCTION*************/
000167 /*gschar (50,25,22,"E TO EXIT");*/
000168
000169
000170
000171
000172
000173 /*SEND THE GDDM DATA TO THE SCREEN**************/
000174 asread(&type,&val,&count);
000175
000176 for (i = 1; i < 10; i++) {
000177 gssaga( 2, 1,1, 0,1, 0,0, i,i, 0);
000178 asread(&type,&val,&count);
000179
000180 }
000181
000182 fsterm();
000183 }
|
|
|
| Back to top |
|
 |
epicdave
New User
Joined: 11 Oct 2007 Posts: 16 Location: New York
|
|
|
|
I just figured out what the problem was. When calling gsscls from C, you need to use the syntax gsscls(), not gsscls. The strange thing is that the compiler doesn't give you a syntax error when you omit the parenthesis, it seems to just ignore the statement. Oh well, it works and I'm a happy code monkey.
thanks for all your help :-)
-David |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8733 Location: 221 B Baker St
|
|
|
|
You're welcome
Thanks for letting us know the solution.
d |
|
| Back to top |
|
 |
|
|
|